Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Closing Oracle cursors

by Transient (Hermit)
on Apr 19, 2005 at 18:57 UTC ( [id://449396]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Closing Oracle cursors
in thread Closing Oracle cursors

Hmm.. I'm wondering if there isn't some type of error upstream.

I assume you're able to iterate through the cursor?

Can you manually open a cursor and retrieve it and then close it? (i.e. without using AUTOLOAD - just hardcode some sql string, pass it in, loop through the cursor, call CloseCursor?)

How about using RaiseError => 1?

If I get a moment to test here, I will give it a shot.

Replies are listed 'Best First'.
Re^6: Closing Oracle cursors
by mickey (Acolyte) on Apr 19, 2005 at 19:26 UTC

    Yes, I can retrieve data from the cursor without a problem.

    I tried modifying the curref.pl example script, and I get the following error:

    The package has been created... The package body has been created... These are the results from the ref cursor: 0 rows Use of uninitialized value in subroutine entry at curref.bat line 83. DBD::Oracle::st dump_results warning: at curref.bat line 83. Unable to SELECT from SYS.V_$OPEN_CURSOR: User testuser needs SELECT p +ermission. DBD::Oracle::st execute failed: ORA-01008: not all variables bound (DB +D: oexec error) at curref.bat line 93.

    So from that error message, one problem is that the user I'm connecting as doesn't have the appropriate permissions. In my workplace getting that permission will be difficult, I think.

    But the last error message is noteworthy -- that's what happens when the procedure to close the cursor is called, and it's exactly what happens when I try to do the same using bind_param() instead of bind_param_inout().

    There's only one variable, and I'm binding it, so I don't know why it thinks I'm not binding all variables.

    Could this be a problem in my version of Perl, DBI, or DBD::Oracle?

      To be honest, I'm not entirely sure. I haven't used cursors/refs wrt DBD::Oracle. What versions of each do you have?

      The only other suggestions I can offer is to find a DBD::Oracle forum and/or try the following I found in the Changes:
      Added ability to pass existing DBD::Oracle select statement handle (cursor) back _into_ Oracle as a ref cursor type thanks to Mike Moretti. Note that this enables a workaround for closing ref cursors: $dbh->do("BEGIN CLOSE :cursor; END;", undef, $sth_ref_csr_to_close);

        DBD::Oracle 1.16
        DBI 1.43
        Perl 5.6

        I tried that workaround as well and I get a different error:

        panic: dbd_rebind_ph alen 23 > maxlen 0 (incnul 0) at C:/Perl/site/lib +/DBI.pm line 1428.

        So I'm not sure where to go myself.

        Thanks very much for looking into it, anyway!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://449396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-20 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found