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

Home -> Community -> Usenet -> c.d.o.server -> How To Execute Sqlplus Scripts At The Command Line

How To Execute Sqlplus Scripts At The Command Line

From: aleatory <aleatory_at_hotmail.com>
Date: 11 Jan 2005 15:31:03 -0800
Message-ID: <a68a4ee0.0501111531.c128a8@posting.google.com>


Hi Oracle masters,

I have a question on sqlplus. How could I execute my sqlplus scripts at the command line? It would be great if I could get output files just executing shell scripts at the command line.

I've tried some of the tips described in the book "Beginning Oracle Programming," but have been no luck yet.

The following files, "test.ksh," and "test.sql" are the ones I use for this purpose:

| //File: test.ksh
| #!/usr/bin/ksh
|
| sqlplus -S '/as sysdba'
| sqlplus -S userID/password @test.sql

| //File: test.sql
| SELECT *
| FROM dba_tablespaces;

It would be great if I could do the following at the command line:

| $ ./test.ksh > out_test

Finally, I use AIX 4.3 and Oracle 8i Enterprise Edition for this.

Many thanks in advance,

alea Received on Tue Jan 11 2005 - 17:31:03 CST

Original text of this message

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