-
I have about 110 tables in a database that all contain a column named session_id. All of the tables start with ETL_. I need to write a pl/sql procedure that will look at a special table, retrieve the max session_id and then update all of the etl_ tables with that session_id (if currenly null). Is there a way to do this with dynamic sql????
Shannon
-
Something like:
declare
cursor cu_tab_name is
select table_name
from user_tables
where table_name like 'ETL%';
begin
-- read MAX session_id from special table
for rec_tab in cu_tab_name loop
execute immediate 'update '||rec_tab.table_name||
' set session_id = '||v_max_sess_id||'
' where session_Id is not null'
end loop;
end;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|