2.11 Batch Command Files


The previous section illustrates SQL*Plus scripts totally embedded within another scripting language, in this case Korn Shell. You can alternatively invoke SQL*Plus as an executable program passing as arguments: the username, password, and connect string.

The following is a host script file that will invoke SQL*Plus. Section 2.9, "Command Line Arguments," contains a SQL script, QUERY_V1.SQL, that accepts a single command line parameter. This same script can be invoked in a batch script, shown next .

 
 echo "host scripting language" sqlplus scott/tiger@ora10 @c:\my_sqlplus\query_v1.sql status exit echo "host scripting language" 

If you do not have an EXIT within the SQL*Plus script, and that certainly is one option, then you will need an EXIT following the invocation of SQL*Plus. The EXIT is needed to take you out of SQL*Plus and back into the original shell.



Programming Oracle Triggers and Stored Procedures
Programming Oracle Triggers and Stored Procedures (3rd Edition) (Prentice Hall PTR Oracle Series)
ISBN: 0130850330
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Kevin Owens

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net