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

Home -> Community -> Usenet -> c.d.o.misc -> Run a script at the OS command prompt

Run a script at the OS command prompt

From: Sashi <smalladi_at_gmail.com>
Date: Tue, 03 Jul 2007 06:15:11 -0700
Message-ID: <1183468511.865777.173480@k79g2000hse.googlegroups.com>


All, I'm an sqlplus newbie and am trying to run a simple select at the operating system command prompt (and NOT the sqlplus command prompt).

My command is like this:
$bash-2.03> sqlplus user/password @/tmp/qry.sql >/tmp/out.sql

Well, I have a select * from my_table in the qry.sql file. That's it.

What I'd like to do is simply run this command and get the output captured into the out.sql file.

When I examine the output, I see that each line of the output is preceded the column name (ugh) and I'm getting newlines before the record terminates.

So:
how do I specify an input and out file for running what I want to run? Exit sqlplus as soon as the query is done (for this I can probably simply put "exit" at the end of my qry.sql) script. For those who are familiar with isql in Sybase, the isql command has a -i and -o flags for the input and output files and runs the commands from the input files, stores the result in the output file and exits. TIA,
Sashi Received on Tue Jul 03 2007 - 08:15:11 CDT

Original text of this message

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