Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to call oracle package procedure from DOS batch file?

Re: how to call oracle package procedure from DOS batch file?

From: Mladen Gogala <mgogala_at_allegientsystems.com>
Date: Mon, 07 Mar 2005 10:37:19 -0500
Message-ID: <422C752F.50907@allegientsystems.com>


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-l
Received on Mon Mar 07 2005 - 10:40:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US