Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Instream SQL in an NT Batch script

Re: Instream SQL in an NT Batch script

From: <bobmetelsky_at_comcast.net>
Date: Fri, 23 Jul 2004 15:32:46 -0400
Message-ID: <410167DE.8030401@comcast.net>


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



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org 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
-----------------------------------------------------------------
Received on Fri Jul 23 2004 - 14:29:29 CDT

Original text of this message

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