Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 29 Mar 2013 @ 10:00:07 GMT


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


Subj:   Parameterized column selection
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, March 28, 2013 23:44 -->

Hi All,

I am not able to apply a logic for the below mentioned case. PLEASE HELP!!

I have one table table1 which contains suppose 5 columns. These columns are populated from a table table2 using BTEQ.

     INSERT into table1
     Select
     Col1,
     Col2,
     Col3,
     Col4,
     Col5       -- configurable
     From table2

Table2 contains 30 columns suppose.

Here I want to keep col5 configurable, i.e. col5 can be replaced with col6, col7, col8 or so on whenever required. I don't want to change the BTEQ script always to do this.

Hence I am creating a pilot table where I can mention which column should be taken in the select query as a replacement of col5.

Eg.

     Pilot table
     Table_nm          col_nm
     -----------       -------------
     Table2            col6

I can simply update the column col_nm with column name which I want to select in the BTEQ query. But how to do this I am not sure.

PLEASE HELP!!!


Cheers



     
  <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