Cannot execute stored proc from oraperl
Date: 1996/01/22
Message-ID: <tuleDLLHFB.Aqo_at_netcom.com>#1/1
My oraperl script returns error:
ORA-00900: invalid SQL statement at net.pl line 17
whenever I try to execute a stored procedure from oraperl
Here is my script:
#!/usr/bin/oraperl
$ora_debug = shift if $ARGV[0] =~ /^-#/;
$vsep = '\|';
die ("You should use oraperl, not perl\n") unless defined &ora_login;
# # Login #
$lda = &ora_login("dmi", "scott", "tiger")
|| die $ora_errstr; #
# execute stand-alone stored procedure get_emp #
$csr1=&ora_open($lda,'EXECUTE get_emp(:1)') || die $ora_errstr; # <<<< line 17
$status = &ora_bind($csr1,"KING") || die $ora_errstr;
print $status,"=",$status,"\n";
do ora_close($csr1) || die "can't close cursor"; do ora_logoff($lda) || die "can't log off Oracle";
# END OF oraperl script
there is no problem when sqlplus executes this procedure Here is proof
SQL> execute get_emp('KING');
PL/SQL procedure successfully completed.
SQL> exit
Obviously, oraperl does not understand 'execute' statement. I assume that 'execute' is SQL statement, anything I pass through oraperl should be passed to SQL parser. Why does not SQL parser regconize 'execute' as a legal command?
Can anyone help?
Thanks
-- NAMES Tu Le tule_at_netcom.comReceived on Mon Jan 22 1996 - 00:00:00 CET