Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Extractin a QUERY TEXT from a Column and using this output we need to insert the data into another table. - response (2) by Raja_KT

$
0
0

Hi,

What I did is something liks this to get the insert into :

select 'insert into '||trim(databasename)||''||trim(tablename) from dbc.tables where tablename='raja_test' and databasename='xxxx';

 

In conjunction, I feel you need to have a matching condition of insert into... against the select * from xxx., something similar( just  pseudo )

 

select 'insert into'||trim(databasename)||''||trim(tablename)||'' ||trim(from dbc.tables(say) a.,dbc.qrylog (say) b where tablename=raja_test; and databasename=xxxx ......

 

where a.tableid1=b.tableid1....

 

(hint :you can enter an order such that you can match one table against another)

 

Hope you get the logic.

 

 

For a small number of tables, you can use export and then use along with excel, it is quite handy

 

 

 

Cheers,

 

Raja


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>