Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Wed, 08 Aug 2007 @ 09:37:27 GMT


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


Subj:   Re: Create table in a Macro
 
From:   McCall, Glenn David

Did/Can you try using a procedure?

Here is an example based upon dbc.dbcinfo.

     replace procedure t (in param varchar(10))
     begin
         CALL DBC.SysExecSQL ('create table dbcinfo_copy as (
                  select *
                  from dbc.dbcinfo
                  where infokey = ''' || :param || '''
              )
              with data;'
          );    /* This is the end of the call DBC.SysExecSQL */

     end;

I will let you rework it for your query. Obviously you can only run this once - unless you drop the table you just created. You could put the drop in the procedure call as well just to be safe.


Glenn Mc



     
  <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: 28 Jun 2020