Re: Instream SQL in an NT Batch script

  • From: "bobmetelsky@xxxxxxxxxxx" <bobmetelsky@xxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 23 Jul 2004 15:32:46 -0400

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;

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

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....


Please see the official ORACLE-L FAQ:
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
Archives are at
FAQ is at

Other related posts: