Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Thu, 18 Aug 2016 @ 23:02:07 GMT


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


Subj:   Re: Create table problem
 
From:   Frydryszak, Marek

     replace PROCEDURE create_from_a
      (
        TbName varchar(128)
       )

      begin
        DECLARE cret varchar(4096);  --or more

        set cret='create table ' || TbName || '( ID integer';
        FOR rbf AS
           SELECT trim(variable) || ' ' || trim(datatype) vartp  FROM A
               WHERE tablename=TbName /* order by ?? */
         DO
             set cret=cret || ', ' || rbf.vartp;
         END FOR;
         set cret=cret || ') primary index(ID)';

        CALL DBC.SysExecSQL(cret);
      end;

      call create_from_a('ABU');


     
  <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: 24 Jul 2020