Path: news.easynews.com!easynews!feedwest.aleron.net!aleron.net!news-out.newsfeeds.com!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!tethys.csu.net!nntp!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: "Andrew King" <kingster_1969@hotmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Call SQL script from Windows .bat file with error checking **NEWBIE**
Date: Thu, 6 Jun 2002 13:15:20 -0400
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <ufv66g7e7ta8c3@corp.supernews.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Complaints-To: newsabuse@supernews.com
Lines: 23
Xref: easynews comp.databases.oracle.server:149766
X-Received-Date: Thu, 06 Jun 2002 10:13:25 MST (news.easynews.com)

I am currently trying to call a SQL*Plus script from a Windows batch file.
I have figured it all out, except for one little piece - I need an error
code returned to the %errorlevel% environment variable if there is a problem
in the execution of the script/stored proc.

This is what I have so far in my batch file:

set ORACLE_SID=edwm
set ORACLE_HOME=d:\oracle\ora81ee
D:
cd D:\ora\edwm\whs\sql
d:\oracle\ora81ee\bin\sqlplus username/password @whsverify.sql

I have seen things in some scripts/stored procs that I have looked at like
"whenever sqlerror exit SQL.SQLCODE".  Will this do what I am looking for?

Thanks,

Andy




