From oracle-l-bounce@freelists.org Mon Mar 7 10:40:33 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id j27GeXgQ024647 for ; Mon, 7 Mar 2005 10:40:33 -0600 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id j27GeWem024643 for ; Mon, 7 Mar 2005 10:40:32 -0600 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 095CF7ECD0; Mon, 7 Mar 2005 10:39:02 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28260-02; Mon, 7 Mar 2005 10:39:01 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7D16C7EC85; Mon, 7 Mar 2005 10:39:01 -0500 (EST) Message-ID: <422C752F.50907@allegientsystems.com> Date: Mon, 07 Mar 2005 10:37:19 -0500 From: Mladen Gogala User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: GMei@ph.com Cc: "Oracle-L (E-mail)" Subject: Re: how to call oracle package procedure from DOS batch file? References: <7E62D965D357694C993D4F0E13B3C39B04D37F40@phexchange.ph.com> In-Reply-To: <7E62D965D357694C993D4F0E13B3C39B04D37F40@phexchange.ph.com> Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 17018 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: mgogala@allegientsystems.com Precedence: normal Reply-To: mgogala@allegientsystems.com X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on air891.startdedicated.com X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=ham version=2.60 X-Spam-Level: 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@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