SET SERVEROUTPUT ON SIZE 1000000
SET ECHO OFF
SET VERIFY OFF
SET DEFINE "~"
SET ESCAPE ON
DECLARE
XROW ROWID; --You cant directly give Row Id to the x_rowid parameter,
ln_rowid1 ROWID;
l_rowid VARCHAR2(100):= 0;
l_rec number:= 0;
CURSOR c
IS
Select aa.LOOKUP_TYPE,aa.lookup_code,aa.meaning,aa.description,aa.tag,aa.VIEW_APPLICATION_ID, bb.tag new_tag,bb.description new_description
from fnd_lookup_values aa
,XXJG_GL_ACCOUNT_MAP bb
where aa.lookup_type = 'OGL_ACCOUNT_MAP'
and aa.LOOKUP_CODE = bb.LOOKUP_CODE
and aa.LOOKUP_CODE <> '416020105' ; --Custom Query to have fetch in my custom table
--cursor c1 is
--select distinct LOOKUP_TYPE
--from xxcsb.xxcsb_gl_lookup_values_stg;
BEGIN
DBMS_OUTPUT.put_line ('Loop');
for i in c -- For loop for Inserting lookup values
loop
l_rowid := NULL;
--DBMS_OUTPUT.put_line ('inLoop');
BEGIN
fnd_lookup_values_pkg.update_row (
x_lookup_type => I.LOOKUP_TYPE,
x_security_group_id => 0,
x_view_application_id => I.VIEW_APPLICATION_ID,
x_lookup_code => I.LOOKUP_CODE,
x_tag => I.NEW_TAG,
x_attribute_category => NULL,
x_attribute1 => NULL,
x_attribute2 => NULL,
x_attribute3 => NULL,
x_attribute4 => NULL,
x_enabled_flag => 'Y',
x_start_date_active => NULL,
x_end_date_active => NULL,
x_territory_code => NULL,
x_attribute5 => NULL,
x_attribute6 => NULL,
x_attribute7 => NULL,
x_attribute8 => NULL,
x_attribute9 => NULL,
x_attribute10 => NULL,
x_attribute11 => NULL,
x_attribute12 => NULL,
x_attribute13 => NULL,
x_attribute14 => NULL,
x_attribute15 => NULL,
x_meaning => I.MEANING,
x_description => I.new_description,
-- x_creation_date => SYSDATE,
-- x_created_by => 1197,
x_last_update_date => SYSDATE,
x_last_updated_by => 1197,
x_last_update_login => 74795
);
l_rec := l_rec+1;
--I := I+1;
DBMS_OUTPUT.put_line (l_rec ||'-'|| I.LOOKUP_CODE);
DBMS_OUTPUT.put_line (ln_rowid1);
Commit;
Exception
when others then dbms_output.put_line('Exception Occurred: '||SQLERRM);
END;
Commit;
end loop;
Exception
when others then dbms_output.put_line('Exception Occured: '||SQLERRM);
END;
/