Archives of the TeradataForum
Message Posted: Wed, 20 Feb 2008 @ 17:13:01 GMT
Subj: | | Re: Conditional Table Drop |
|
From: | | richard.knott1 |
If you're doing it via a BTEQ batch job then the easiest way to do it is:-
Select count(*) from table a;
IF ERRORCODE = 3801 THEN .GOTO DROP
IF ERRORCODE = 0 THEN .GOT NO_DROP
.LABEL DROP
DROP TABLE table A";
.LABEL NO_DROP
Carry on with your SQL here
That way you only ever enter into the drop statement if the errorcode = 3801 (table doesn't exist).
Apologies if this isn't what you asked.
Regards
Richard
|