Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 20 Dec 2003 @ 14:37:41 GMT


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


Subj:   Re: Suggestions for checking whether table exists or not
 
From:   Meade, Cornelius

This is not exactly what you were asking for but it illustrates how you can do the type of thing you are asking about in a BTEQ script file. Instead of doing a "DROP TABLE" command to could use something less destructive/innocuous that would determine if the table in question existed (such as a SELECT COUNT(*) FROM TABLE_NAME or something else that would be quick to execute depending on your environment)....

--
 DROP TABLE TABLE_NAME ;

.IF ERRORCODE=3807 THEN .GOTO CONTINUE

.IF ERRORCODE>4 THEN .GOTO ERRORS

.LABEL CONTINUE

 CREATE TABLE TABLE_NAME ....


.IF ERRORCODE>4 THEN .GOTO ERRSEV

.QUIT 0

.LABEL ERRORS

.QUIT ERRORCODE


     
  <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