Welcome! This is a website that everyone can build together. It's easy!

Location: Oracle Enterprise Taxation Management

Discussion: Change Env ID (v2.x)

Keyword tags: None

Watch

Anonymous  (Get credit for your thread)


DouwSteyn

DouwSteyn
Change Env ID (v2.x)
Feb 13 2008, 12:03 PM EST
You need different environmental ID fto do a config lab (or archiving registration)
The below script will help you to change the env id's for all affected tables

set serveroutput on size 1000000

DECLARE
t_c1_tname user_tables.table_name%TYPE;
t_cid integer;
stat integer;
row_count integer;
cursor C1 is
select rtrim(key_tbl_name) from ci_md_tbl where key_tbl_name <> ' '
order by 1;
BEGIN
open c1;
loop
fetch c1 into t_c1_tname;
exit when c1%NOTFOUND;
t_cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(t_cid,'UPDATE '||t_c1_tname||' SET ENV_ID=(SELECT ENV_ID FROM F1_INSTALLATION)' ,dbms_sql.native);
stat := DBMS_SQL.EXECUTE(t_cid);
DBMS_SQL.CLOSE_CURSOR(t_cid);

end loop;
close c1;


END;
/
1  out of 3 found this valuable. Do you?    

Sign in to be the first to reply.