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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Call SQL script from Windows .bat file **NEWBIE**

Re: Call SQL script from Windows .bat file **NEWBIE**

From: Andrew King <kingster_1969_at_hotmail.com>
Date: Fri, 7 Jun 2002 08:26:21 -0400
Message-ID: <ug19mant3pmvc1@corp.supernews.com>


"Daniel Morgan" <dmorgan_at_exesolutions.com> wrote in message news:3CFFD1AF.2FFEAA70_at_exesolutions.com...
> Sybrand Bakker wrote:
>
> > "Andrew King" <kingster_1969_at_hotmail.com> wrote in message
> > news:ufv4gi7p1v2ja9_at_corp.supernews.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
> > >
> > >
> >
> > What does the explanation of whenever sqlerror in your sql*plus
> > documentation say?
> >
> > Regards
> >
> > --
> > Sybrand Bakker
> > Senior Oracle DBA
> >
> > to reply remove '-verwijderdit' from my e-mail address
>
> Asking someone to look at the documentation ... have you no shame? <g>
>
> Daniel Morgan
>

I was looking for help with the batch code side of it as well... Not just the SQL code. Not quite a need to hammer me for asking a question like that. As far as looking up the "whenever sqlerror" in the ref guide? Well, that book is about as clear as mud.

So, anyone else have any real help to offer? Received on Fri Jun 07 2002 - 07:26:21 CDT

Original text of this message

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