Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how to update a list of tables using native dynamic sql?
In both statement, you include the trailing semi-colon, which should
not be inserted into your SQL string.
Here is a sample ...
Declare
begin
for i in ( select table_name from user_tables
where table_name in ('T1','T2') loop execute immediate 'Update '||i.table_name|| ' set created_date=sysdate,'||end loop;
' last_modified_date=sysdate,'||
' created_userid=''sale'','||
' last_modified_userid=''sale''';
commit; dbms_output.put_line( 'Updated -> ' || i.tables);
![]() |
![]() |