On Wed, 10 Dec 2003 10:04:28 +0100 Patrick Kuijvenhoven
<[EMAIL PROTECTED]> wrote:

> I just copy/pasted that syntax from documentation. It should be changed
> there as well.

The problem is that you __DIDN'T__ copy the example from the documentation.
Here is the exact code from `perldoc DBI::Oracle`:

  use DBI;
  use DBD::Oracle qw(:ora_types);
  $dbh = DBI->connect(...);
  $sth1 = $dbh->prepare(q{
      BEGIN OPEN :cursor FOR
          SELECT table_name, tablespace_name
          FROM user_tables WHERE tablespace_name = :space;
      END;
  });
  $sth1->bind_param(":space", "USERS");
  my $sth2;
  $sth1->bind_param_inout(":cursor", \$sth2, 0, { ora_type => ORA_RSET } );
  $sth1->execute;
  # $sth2 is now a valid DBI statement handle for the cursor
  while ( @row = $sth2->fetchrow_array ) { ... }
...
  $sth3 = $dbh->prepare("BEGIN CLOSE :cursor END");
  $sth3->bind_param_inout(":cursor", \$sth2, 0, { ora_type => ORA_RSET } );
  $sth3->execute;

Note that $sth2 (AKA $rv in your sample) is the cursor handle, NOT NOT NOT
$sth1 (AKA $func_open).  You must close $sth2 ($rv), not $sth1 ($func_open).

-- 
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to