Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 18 Aug 2016 @ 19:45:17 GMT


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


Subj:   Create table problem
 
From:   Bakthavachalam, Roopalini

Hi Forum,

Need some direction here. I need to create a table whose columns and datatypes needs to be retrieved from another table.

Table A

     Table Name   Variable     Datatype
     ABU          EMPNO        INTEGER
     ABU          NAME         VARCHAR(100)?
     ABU          DEPT         VARCHAR(10)

Now I need to create table ABU like below

     CREATE TABLE ABU
     (
     ID INTEGER
     EMPNO INTEGER
     NAME VARCHAR(100)
     DEPT VARCHAR(100)
     )
     PRIMARY INDEX (ID);

We tried with ALTER TABLE for each variable, however it doesn?t seem to be very efficient as sometime we will have more than 2000 variables and running ALTER TABLE 2000 times is causing issues. Is there any other way.


Thanks

Roopalini



     
  <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: 27 Dec 2016