Wednesday, July 1, 2015

OIM Loading Lookups by Database Query

In this post, I will talk about simple queries to load a particular lookup with a values using database queries.


select lku.lku_key into lku_key from lku where lku.LKU_TYPE_STRING_KEY = LookupName;
 
insert into "LKV" ("LKV_KEY","LKU_KEY","LKV_ENCODED","LKV_DECODED","LKV_LANGUAGE",
"LKV_COUNTRY","LKV_VARIANT","LKV_DISABLED","LKV_DATA_LEVEL","LKV_CREATE","LKV_CREATEBY",
"LKV_UPDATE","LKV_UPDATEBY","LKV_ROWVER") values (LKV_SEQ.nextval, lku_key, encodedValue,
 decodedValue,'en', 'US', null, '0', null, sysdate, 1, sysdate, 1,
 HEXTORAW('0000000000000000')); 


insert into lkv (lkv_key, lku_key, lkv_encoded, lkv_decoded, lkv_language, lkv_country,
lkv_diabled,lkv_disabled,lkv_data_level,lkv_create,lkv_createby, lkv_update, lkv_updateby,
lkv_rowver) values (LKV_SEQ.NEXTVAL,2222, 'encoded_key', 'decoded_value', 'en','US','0',
NULL,SYSDATE,1,SYSDATE,1,HEXTORAW('0000000000000000'));
 
 
get lku_key
 
select * from lku where lku_type_string ='mylookupName';