Re: Capturing the return value from SQL*Plus
From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Fri, 31 Jul 1998 14:16:53 +0200
Message-ID: <6pscj2$6rc$1_at_newton.a2000.nl>
Date: Fri, 31 Jul 1998 14:16:53 +0200
Message-ID: <6pscj2$6rc$1_at_newton.a2000.nl>
MS Dos uses errorlevel to do this:
_at_echo off
rem sqlplus -s yields silent mode
sqlplus -s user/password _at_my_script.sql
rem if errorlevel n yields true when the return rem value equals, or is greater than, n. So rem always process errorlevel from high rem to low!
if errorlevel 2 goto lblExitCode2
if errorlevel 1 goto lblExitCode1
goto lblSuccess
:lblSuccess
echo Normal completion.
goto done
:lblExitCode1
rem some code here
goto done
:lblExitCode2
rem some code here
goto done
:done
exit 0
Success,
Arjan.
Received on Fri Jul 31 1998 - 14:16:53 CEST