Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Conditionally terminating a Batch script.
Hi..
I have a nightly batch process that Downloads data into Oracle and then I have a batch script that formats/manipulates this data.
My problem is that the first thing my script does is truncate the table
before
the data is loaded into it. So if something goes wrong with the load, this
table
will remain empty after my script issues the truncate command.
I don't want the script to continue executing if that is the case because a
bunch
of other destructive commands are issued afterwards, with the assumption
that the data is there.
Is there was a way to test for this???
something like.
select count(*) into <VARIABLE> from table_name
if <VARIABLE> = 0 then
TERMINATE
else
CONTINUE
endif
I know I can do this test with PL_SQL, but unless I'm mistaken I can't issue
a
start <script_name>.sql from within PL_SQL. (I tried several times so either
it is not
allowed, or I'm not using the correct syntax)
Also, sqlplus does not support (if,then,else) logic (as far as I know).
Can someone give me a hand with this problem
Thanks in advance... Received on Sun Aug 01 1999 - 09:52:26 CDT
![]() |
![]() |