denzil_cactus has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, As I hv never used Oracle with Perl...I am unable to get the values which I am fetching in PL/SQL variables.. Can anyone please look into this problem? Here my code ------------------------------------------------------
#!/usr/bin/perl use DBI qw(:sql_types); $dbh=DBI->connect("$datasource","$user","$pwd"); my($input_booking_seq, $fax_header, $file_no,$input_print_rates, $myNo +teId, $printer_name); eval { $sth = $dbh->prepare($sql = q{ DECLARE user_id VARCHAR2(15); input_booking_seq VARCHAR2(20); fax_header VARCHAR2(10); file_no VARCHAR2(15); BEGIN select user_id,passkey, '//FAX(fax=' || passkey1, passkey2 into user_id,input_booking_seq,fax_header,file_no from edit_table where edit_table.tag = 'BOOKING' and edit_table.key = 'PRINT' and id=3; END; }) or die $dbh->errstr; $sth->bind_param(":user_id",$user_id); $sth->bind_param(":input_booking_seq",$input_booking_seq); $sth->bind_param(":fax_header",$fax_header); $sth->bind_param(":file_no",$file_no); $sth->execute; }; if($@){ print "Failed : $DBI::errstr \n"; $dbh->errstr; }else{ print "Returned $user_id,$input_booking_seq,$fax_header,$file_no \n"; } $dbh->disconnect;
-------------------------------------------------------------------------------------------- I want to see the values which I am fetching from select query..

Replies are listed 'Best First'.
Re: Problem in Executing PL/SQL block with Perl
by monarch (Priest) on Jul 09, 2007 at 13:03 UTC
    Did you try running that exact same query in your favourite GUI or command-line SQL interface? Cause, though I don't know for sure, I would bet that the /SELECT.*INTO/ statement does not return results..!

    How about you try running this query without the INTO<table> bit.. if you must populate your temporary table, then why not run an additional SELECT from your newly created table?

    A reply falls below the community's threshold of quality. You may see it by logging in.