On Mon, 6 Oct 2003 07:33:23 -0700 (PDT)
Michael A Chase <[EMAIL PROTECTED]> wrote:

> On Sun, 05 Oct 2003 23:13:50 -0400 Phil R Lawrence <[EMAIL PROTECTED]> wrote:
> 
> > Can anyone help me with this question?  I want to use a stored cursor 
> > from DBI...  My (failed) attempt is below.  Thanks!
> 
> http://search.cpan.org/src/TIMB/DBD-Oracle-1.14/Oracle.ex/curref.pl

Thank you for the excellent URL.  However, I wonder if it is possible to use a 
package.cursor, as opposed to a package.procedure that returns a cursor ref.  In 
PL/SQL, I am able to open and use package.cursors.  But perhaps your way is better for 
some reason?

Anyway, here is my example:

> CREATE OR REPLACE PACKAGE p_lu_ar_bal AS
>         ...
>         CURSOR   c_lu_tbraccd_rowid (as_of_date DATE)
>         IS
>                 SELECT TBRACCD_ROWID
>                 FROM
>                        (
>                          ...
>                        );
>         ...


> I tried:
> 
>   my $open_cursor = $dbh->prepare( qq{
>   BEGIN
>       OPEN p_lu_ar_bal.c_lu_tbraccd_rowid( ? );
>   END;
>   } );
> 
>   $open_cursor->execute( '12-MAY-2003' );
> 
>   while (my $rowid = $open_cursor->fetchrow_array) {
>     print $rowid, "\n";
>   }
> 
> result:
>   DBD::Oracle::st fetchrow_array failed: ERROR no statement
>   executing (perhaps you need to call execute first)

Reply via email to