Archives of the TeradataForum
Message Posted: Fri, 29 Mar 2013 @ 10:00:07 GMT
<-- Anonymously Posted: Thursday, March 28, 2013 23:44 -->
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.
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.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 24 Jul 2020|