Re: Instream SQL in an NT Batch script

Smith, Ron L. wrote:

>I am trying to move a couple of Unix scripts to an NT server.  I know
>just about everything needs to change but the scripts use in stream SQL
>commands and for some reason NT doesn't like the syntax.
>
>The code is simple just like:
>sqlplus / <<EOF
>select something from somewhere;
>EOF
>  
>

if you're trying to pass a carriage return to the file you need to 
create a blank bat
and just press enter in the file and save as ctrl.bat

Then you pass the "key press" to the file

sqlplus user/pass@inst <ctrl.bat

Or, to have a batch file echo sql and then call it

[dbup.bat]
echo set echo off feed off pages 0 >C:\test\dbup.sql
echo whenever sqlerror exit sql.sqlcode >>C:\test\dbup.sql
echo select * from global_name;>>C:\test\dbup.sql
echo exit ;>>C:\test\dbup.sql
rem END

sqlplus user/password@instance @dbup.sql

This is part of a monitor script. If it fails it sends an email
if ERRORLEVEL 1 (.... send an email

Im not sure if this helps....

Bob

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: