I'm getting a "maximum cursors exceeded" error using DBD::Oracle, and to make sure my cursors are closed I'm trying to close them directly myself.
I've written an object wrapper around the DBI object to allow me to call the PL/SQL stored procedures I'm using, so I wrote another method to close a cursor, as follows:
sub CloseCursor { my ($self, $cursor) = @_; unless (defined $cursor) { warn "No cursor passed to CloseCursor!\n"; return 0; } my $sql = __unindent(<<" SQLEND"); ~BEGIN ~ close :cur; ~END; SQLEND my $sth = $self->dbh->prepare($sql); print $sth->{'Statement'}; $sth->bind_param_inout(':cur', \$cursor, 0, { ora_type => ORA_RSET + } ); if ($sth->execute) { return 1; } else { warn "Error closing cursor: ".$sth->errstr."\n"; return 0; } }
I call this method with the inout parameter I passed to the stored proc called previously. I can provide that code if necessary.
I'm receiving this output when calling CloseCursor as above:
Error closing cursor: ORA-01023: Cursor context not found (Invalid cur +sor number) (DBD: odescr failed)
What does this indicate I'm doing wrong?
Thanks for your advice.
In reply to Closing Oracle cursors by mickey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |