Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 20 Feb 2008 @ 17:13:01 GMT


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


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



     
  <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: 15 Jun 2023