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 -> Re: How To Execute Sqlplus Scripts At The Command Line

Re: How To Execute Sqlplus Scripts At The Command Line

From: Dave <x_at_x.com>
Date: Wed, 12 Jan 2005 00:41:17 GMT
Message-ID: <Nm_Ed.8774$GG1.6834@text.news.blueyonder.co.uk>

"aleatory" <aleatory_at_hotmail.com> wrote in message news:a68a4ee0.0501111531.c128a8_at_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

use spool in your sql script Received on Tue Jan 11 2005 - 18:41:17 CST

Original text of this message

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