Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 20 Feb 2008 @ 17:16:32 GMT


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


Subj:   Re: Conditional Table Drop
 
From:   Anomy Anom

<-- Anonymously Posted: Wed, 20 Feb 2008 12:15 -->

we do conditional table drops in stored procs:

we've already set values for the v_result_db and v_result_table

     /* Conditional Drop Result table    */
     SET v_temp = 0;
     SELECT  1
     INTO   v_temp
     FROM      DBC.TABLES
     WHERE    DATABASENAME = TRIM(v_result_db)
              AND        TABLENAME    = TRIM(v_result_table);

     IF v_temp = 1 THEN
         SET v_drp_tbl_str = 'DROP TABLE '
                ||TRIM(v_result_db)
                ||'.'
                ||TRIM(v_result_table);

       /* Execute the sql string to drop the table */
       CALL DBC.SYSEXECSQL(v_drp_tbl_str);
                      END     IF;

Thanks



     
  <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