Re: Sqlplus in Batch file.

From: <>
Date: Fri, 7 Mar 2008 09:42:31 -0800 (PST)
Message-ID: <>

On Mar 7, 11:01 am, PowerOne <> wrote:
> Hi,
> I need a batch file to lunch sqlplus and run a statement but the login
> must be in .par file like this:
> sqlplus @c:\mylogin.par  START @c:\mystatement.sql
> exit
> when I run this .bat file in CMD prompt it open a new CMD logged in
> Sqlplus but it does not the Statement specified.
> What I'm doing wrong?


You'll need to rewrite your .bat and your .par files to look like these examples.

.BAT file:

sqlplus /nolog @mylogin.par


connect user/pass_at_server

<query here>

exit -- To exit SQL*Plus and terminate the session

Once you have this done you should see success:


c:\>sqlplus /nolog @myconn.par

SQL*Plus: Release - Production on Fri Mar 7 11:38:28 2008

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


 <query output here>

Disconnected from Oracle8i Enterprise Edition Release - 64bit Production
With the Partitioning option
JServer Release - 64bit Production


David Fitzjarrell Received on Fri Mar 07 2008 - 11:42:31 CST

Original text of this message