mickey has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Closing Oracle cursors
by sasikumar (Monk) on Apr 19, 2005 at 16:44 UTC | |
|
Re: Closing Oracle cursors
by RazorbladeBidet (Friar) on Apr 19, 2005 at 17:11 UTC | |
by mickey (Acolyte) on Apr 19, 2005 at 17:29 UTC | |
by Transient (Hermit) on Apr 19, 2005 at 18:00 UTC | |
by mickey (Acolyte) on Apr 19, 2005 at 18:48 UTC | |
by Transient (Hermit) on Apr 19, 2005 at 18:57 UTC | |
| |
|
Re: Closing Oracle cursors
by mickey (Acolyte) on Apr 21, 2005 at 20:35 UTC |