Re: Pipe some stuff to SQLPLUS

From: Alvin W. Law <alaw_at_us.oracle.com>
Date: 1995/09/28
Message-ID: <ALAW.95Sep28122708_at_ap283sun.us.oracle.com>#1/1


In article <no.account-270995153537_at_nnsgm831.lon40.nt.com> no.account_at_nt.com (Nick Ife) writes:
> In article <44bjo6$9qd_at_tst.hk.super.net>, chichung_at_hk.super.net (Mr Chung Chi Wong) wrote:
>
> > Hi,
> > I would like to know how can I use sqlplus non-interactively......
> >
> > I have tried the following, but I can't get anything!!!!
> >
> > echo "some sql statement;" | sqlplus user/password
> >
> > sqlplus user/password < "sql statements file"
>
> In my overnight run, I use:
>
> sqlplus -s user/password <<END!
> _at_sql_script_name
> END!
>
> Is that what you wanted?

Actually in your case, you don't need to use redirection; sqlplus accepts a script name (and &1, &2 variable substitution) straight from the command line. So you only need to do:

sqlplus -s user/password _at_sql_script_name

--
 "Everything that can be said about Win95 has been said... The Win95 user
  interface is not nearly as good as the Mac.  Blah, blah.  It has all been
  said a thousand times." - Larry Ellison

 Alvin W. Law ........................................... Oracle Corporation
 Senior Technical Consultant ................ 300 Oracle Parkway, Box 659305
 Applications Design & Architecture ............... Redwood Shores, CA 94065
 Email: alaw_at_oracle.com ...... Voice: +1.415.506.8317 . Fax: +1.415.506.7294
Received on Thu Sep 28 1995 - 00:00:00 CET

Original text of this message