Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to call oracle package procedure from DOS batch file?
Guang Mei wrote:
>Hi,
>
>Just started to program on WindowXP side using DOS batch file. I have this
>question.
>
>1. In batch file, if I want to call a procedure in a package with parameters
>defined in the batch file, how do I do that?
>
>
>REM : try to call my_package.my_procedure with two parameters
>REM: %1 is user/pass_at_db
>
>sqlplus -S %1 "exec my_package.my_procedure (:%2, :3% ) << EOF
>exit
>EOF
>
>does not seem to work.
>
>TIA.
>
>
Solution should contain something like this:
my $db=DBI->connect("dbi:Oracle:$tns",$username,$password);
my $sth=$db->prepare($SQL)
$sth->Execute($sth, @binds);...
I assure you that it will become your favorite method of writing SQL
batches, once you get to know it.
In the meantime, please read the collected works of Randall Schwartz,
Tom Christiansen, Larry Wall,
Damian Conway and Jared Still. It should keep you up at night for a
weekend or two.
-- Mladen Gogala Oracle DBA Ext. 121 -- http://www.freelists.org/webpage/oracle-lReceived on Mon Mar 07 2005 - 10:40:33 CST