|
|
Archives of the TeradataForum
Message Posted: Tue, 13 Jul 2004 @ 11:59:34 GMT
Subj: | | Re: If Exists Then ...Else .... |
|
From: | | Khan, Rehan |
Allan,
In Bteq We do it like this, there may be some other ways as well.
/***************************/
SELECT
COUNT(* )
FROM
dbc.tables
WHERE
databasename = 'DD_STG'
AND tablename = 'ACCOUNT_CARD'
HAVING
COUNT(*) > 0;
.IF ERRORCODE <> 0 THEN .QUIT 10;
.IF ACTIVITYCOUNT = 1 THEN .GOTO DROP_TAB;
.IF ACTIVITYCOUNT = 0 THEN .GOTO CT_TAB;
/***************************/
___________________________________________________________________
Best Regards,
Rehan A. Khan
Teradata Certified Master
Teradata, A Division of NCR
| |