I hope you understand this logic 1:
select 'insert into '||trim(databasename)||''||trim(tablename) from dbc.tables where tablename='raja_test' and databasename='xxxx'; ---It gets you the statement
insert into yourdbname.yourtablenam Note :You can use IN instead of = sign
Since I can see you have only around 50 rows, you can use excel against your queries and then paste the whole code into a bteq and run.
I tried for one row and it works as below:
select 'insert into '||trim(t.databasename)||'.'||trim(t.tablename)||a.id from dbc.tables t,xxxx.raja_test a where t.tablename='raja_test' and t.databasename='xxxx'
and t.tablename=a.tablename
ct xxxx.raja_test(id varchar(5000),tablename varchar(30));
insert into xxxx.raja_test('select (*) from abc','raja_test');
Hope you will try at least :).
Cheers,
Raja
I hope you understand this logic 1:
select 'insert into '||trim(databasename)||''||trim(tablename) from dbc.tables where tablename='raja_test' and databasename='xxxx'; ---It gets you the statement
insert into yourdbname.yourtablenam Note :You can use IN instead of = sign
Since I can see you have only around 50 rows, you can use excel against your queries and then paste the whole code into a bteq and run.
I tried for one row and it works as below:
select 'insert into '||trim(t.databasename)||'.'||trim(t.tablename)||a.id from dbc.tables t,xxxx.raja_test a where t.tablename='raja_test' and t.databasename='xxxx'
and t.tablename=a.tablename
ct xxxx.raja_test(id varchar(5000),tablename varchar(30));
insert into xxxx.raja_test('select (*) from abc','raja_test');
Hope you will try at least :).
Cheers,
Raja