Re: SQL*Plus Batch Mode Supported on Windows?
Date: Sat, 21 Jul 2001 21:46:51 GMT
Message-ID: <3b152339_at_news.victoria.tc.ca>
Tony Murphy (tony_murphy_at_yahoo.com) wrote:
: hi,
: can someone tell me if its possible to run a sql*plus batch file under windows. I get an error
: D:\Development\Java\Test\Java-Stored-Procedure\HelloWorld>echo off
: Loading Java Stored Procedure
: << was unexpected at this time.
: When I run a .bat file containing the following commands:
: ----------------------------------------------------------------
: echo off
: echo Loading Java Stored Procedure
: sqlplus -silent scott/tiger <<EOF
: whenever sqlerror continue
: create or replace function HELLOWORLD return VARCHAR2 as
: language java name 'Hello.world () return java.lang.String';
: /
: EOF
: ------------------------------------------------------------------
: looks like syntax that works under unix doesn't work under windows
First, there are two versions of sqlplus, one is a GUI, and one is the command line version. You need to ensure you are using the command line version to run in batch files.
Second, I would like refrase your above to...
"looks like syntax that works under one command shell doesn't always work under a different command shell"
To solve your problem
-1- create a seperate file with the SQL commands you need -2- run the correct sqlplus -3- use the _at_ argument on the command line to run the sql file
So the batch file will look something like this
REM Run sql plus command line on a .SQL file plus33 scott/tiger_at_host @your-file.sql
and the sql file will look something like
- these are the sql commands create or replace function HELLOWORLD return VARCHAR2 as language java name 'Hello.world () return java.lang.String';
-- Want to access the command line of your CGI account? Need to debug your installed CGI scripts? Transfer and edit files right from your browser? What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgiReceived on Sat Jul 21 2001 - 23:46:51 CEST