I'll assume you can connect to Oracle although you should enclose your 
DBI->connect with "eval", but anyways have u also tried using DBI->trace() 
to "see" what is actually being fetched?  place parens around @data and c 
if that makes a difference.  just some thoughts, though it's been awhile 
since i've coded in perl

you can also try just using fetchrow like:

while ( (@data) = $rv->fetchrow() )
{
   print "@data\n";

}

At 03:35 PM 7/30/02 +0530, Sundarraj, Senthil Kumar (Cognizant) wrote:
>Hi All,
>
>         I have a stored procedure as like this..
>         procedure example
>         is
>         cursor html_cur
>         is
>           select  a, b from html_bill ;
>           a varchar2(20);
>           b varchar2(20);
>         BEGIN
>         NULL;
>         END;
>
>         The table html_bill contains 5 records.
>
>         am using a perl script like below to invoke the stored procedure.
>
>         use Oraperl;
>         my ($sth, $stmt,$SQL, $return);
>         $dbh=
>DBI->connect('dbi:Oracle:host=hostname;sid=net','test','test');
>
>         $SQL = "BEGIN example; END;";
>         $func= $dbh->prepare($SQL);
>         $rv = $func->execute;
>         print "No of rows = " . $func->rows() . "\n";
>         while(@data=$func->fetchrow_array){
>                 print "@data\n";
>         }
>
>         if ( $@ ) {
>                 warn " Execution of stored procedure failed:
>$DBI::errstr\n";
>                 $dbh->rollback();
>         }
>         print "Excution of stored procedure returned $rv\n";
>         $dbh->disconnect();
>
>         It says Number of rows as 1 and am not able to fetch the selected
>rows(it says some error).
>
>Any idea how to manipulate the selected rows.
>
>Senthil Kumar
>3rd Floor,27,Whites Rd
>ph #  044 - 8529917/8526917 x : 3791
>

  • Problem... Sundarraj, Senthil Kumar (Cognizant)
    • Jonathan Gines

Reply via email to