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);
SELECT fou.oracle_username into v_fnd_schema
FROM fnd_product_installations fpi,
fnd_oracle_userid fou,
fnd_application fa
WHERE fpi.application_id = fa.application_id
AND fpi.oracle_id = fou.oracle_id
AND fa.application_short_name = 'FND';
SELECT application_short_name into app_short_name
FROM fnd_application
WHERE application_id = p_taplid;
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;