Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> 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_at_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_at_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
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Fri Jul 23 2004 - 14:29:29 CDT