Hello,
I need to insert data from a table into the same table with a different company_code (CMPCODE). This has to be done for about 250 tables, so I thought I might be able to do this in Dynamic SQL. But I've no idea how to do it!
I've seen some examples on the internet, but I'm a complete newbie when it comes to oracle... :-(
So basically, what I want is a script which executes:
insert into @table_name
select new_cmpcode
,column2
,column3
,...
from @table_name
and this script has to be generated by a dynamic sql script...??
1> All tables start with OAS_name AND should contain the column CMPCODE.
2> the column to be changed is CMPCODE (the first column of the table; contains 'OAD' now, and should be inserted with 'T-OAD')
Can anyone help me with this one??
Thanks in advance for your time...
I need to insert data from a table into the same table with a different company_code (CMPCODE). This has to be done for about 250 tables, so I thought I might be able to do this in Dynamic SQL. But I've no idea how to do it!

I've seen some examples on the internet, but I'm a complete newbie when it comes to oracle... :-(
So basically, what I want is a script which executes:
insert into @table_name
select new_cmpcode
,column2
,column3
,...
from @table_name
and this script has to be generated by a dynamic sql script...??
1> All tables start with OAS_name AND should contain the column CMPCODE.
2> the column to be changed is CMPCODE (the first column of the table; contains 'OAD' now, and should be inserted with 'T-OAD')
Can anyone help me with this one??
Thanks in advance for your time...