Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 13 Jul 2004 @ 11:59:34 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016