The following lines contain the word 'select', 'insert', 'update' or 'delete':
select owner from
dba_tables where
table_name = c_tabname and
owner in (select oracle_username from fnd_oracle_userid);
select column_name from dba_tab_columns where
column_name <> 'ROW_KEY' and column_id > 7 and
table_name = c_tabname and
owner = c_owner
order by column_id;
select table_name from fnd_tables where
application_id=c_appid and
table_id = c_tabid;
v_updatetable varchar2(2000);
v_updatetable := 'update '|| v_owner ||'.'|| v_oldtname || ' set row_key = ' ||
'(TO_NUMBER(TO_CHAR(AUDIT_TIMESTAMP,''YYYYMMDDHH24MISS''))'
|| '* 100000 + MOD(AUDIT_SEQUENCE_ID,100000)) * 100000 + AUDIT_SESSION_ID';
execute immediate (v_updatetable);
v_createtable := 'create table ' || v_owner ||'.'|| v_tname || ' as (select audit_timestamp, audit_transaction_type, audit_user_name, audit_true_nulls, audit_session_id, audit_sequence_id, audit_commit_id, row_key';
execute immediate ('select count(*) from '|| v_owner ||'.'|| v_tname) into tcount;
execute immediate ('select count(*) from '|| v_owner ||'.'|| v_oldtname) into toldcount;