Re: Sqlplus in Batch file.

From: <fitzjarrell_at_cox.net>
Date: Mon, 10 Mar 2008 08:22:58 -0700 (PDT)
Message-ID: <8147154f-6aec-4152-846f-5cd4756162a9@s50g2000hsb.googlegroups.com>


On Mar 9, 8:51 pm, Michael Austin <maus..._at_firstdbasource.com> wrote:
> fitzjarr..._at_cox.net wrote:
> > On Mar 7, 11:01 am, PowerOne <salazar.wi..._at_gmail.com> 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?
>
> > Much.
>
> > You'll need to rewrite your .bat and your .par files to look like
> > these examples.
>
> > .BAT file:
>
> > sqlplus /nolog @mylogin.par
>
> > mylogin.par:
>
> > connect user/pass_at_server
> > @c:\mystatement
>
> > c:\mystatement.sql:
> > <query here>
>
> > exit  -- To exit SQL*Plus and terminate the session
>
> > Once you have this done you should see success:
>
> > c:\>run_sqlplus_script
>
> > c:\>sqlplus /nolog @myconn.par
>
> > SQL*Plus: Release 10.2.0.3.0 - Production on Fri Mar 7 11:38:28 2008
>
> > Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
>
> > Connected.
>
> >  <query output here>
>
> > Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 -
> > 64bit Production
> > With the Partitioning option
> > JServer Release 8.1.7.4.0 - 64bit Production
>
> > c:\
>
> > David Fitzjarrell
>
> using a 10.2.0.3 client connecting to an 8.1.7.4 db?  A bit old -- and
> unsupported? :)- Hide quoted text -
>
> - Show quoted text -

And you have a better solution for vendors who don't, or won't, port their application to a newer release? They are few and far between here, however they still exist.

I'm so glad you live in a dream world where all of your applications are current and all of your databases are of the most recent release. Many of us do not.

David Fitzjarrell Received on Mon Mar 10 2008 - 10:22:58 CDT

Original text of this message