The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT object_id
FROM
FND_OBJECTS
WHERE obj_name = cp_entity_name;
SELECT
parties.party_name grantee_name,
grantee_type,
role_name,
role_display_name,
menu_id
FROM hz_parties parties,
(
SELECT DISTINCT
GRANTS.grantee_orig_system_id grantee_orig_system_id,
DECODE(grants.grantee_key,'GLOBAL','HZ_GLOBAL', SUBSTR(grants.grantee_key,0, INSTR(grants.grantee_key,':',1,1)-1)) grantee_orig_system,
GRANTS.grantee_type grantee_type,
GRANTS.grantee_key grantee_key,
menus.Menu_name role_name,
menus.user_menu_name role_display_name,
menus.menu_id menu_id
FROM fnd_grants GRANTS,
fnd_objects OBJECTS,
fnd_menus_vl MENUS
WHERE OBJECTS.object_id = GRANTS.object_id
AND OBJECTS.obj_name=cp_entity_name
AND GRANTS.instance_type='INSTANCE'
AND GRANTS.instance_pk1_value=cp_pk1_value
AND
(
(
grants.instance_pk2_value = cp_pk2_value
)
OR
(
(
grants.instance_pk2_value = '*NULL*'
)
AND
(
cp_pk2_value is NULL
)
)
)
AND
(
(
grants.instance_pk3_value = cp_pk3_value
)
OR
(
(
grants.instance_pk3_value = '*NULL*'
)
AND
(
cp_pk3_value is NULL
)
)
)
AND
(
(
grants.instance_pk4_value = cp_pk4_value
)
OR
(
(
grants.instance_pk4_value = '*NULL*'
)
AND
(
cp_pk4_value is NULL
)
)
)
AND
(
(
grants.instance_pk5_value = cp_pk5_value
)
OR
(
(
grants.instance_pk5_value = '*NULL*'
)
AND
(
cp_pk5_value is NULL
)
)
)
AND GRANTS.menu_id = MENUS.menu_id
AND
(
(
cp_role_name is null
AND menus.menu_name like '%'
)
OR
(
MENUS.MENU_NAME in (cp_role_name)
)
)
AND GRANTS.start_date <= sysdate
AND
(
GRANTS.end_date is null
OR grants.end_date >= SYSDATE
)
)
grants
WHERE grantee_type in ('USER','GROUP') --,'COMPANY','GLOBAL')
AND grantee_orig_system in ('HZ_PARTY','HZ_GROUP') --,'HZ_COMPANY', 'HZ_GLOBAL')
AND parties.party_id=DECODE(grants.grantee_key,'GLOBAL',-1000, SUBSTR(grants.grantee_key, INSTR(grants.grantee_key,':',1,1)+1));
cursor_select NUMBER;
'SELECT ' ||
'ltrim(grantee_person.party_name,''* '') grantee_name, ' ||
' grantee_type grantee_type, ' ||
'granted_menu_data.menu_name role_name, ' ||
'granted_menu.user_menu_name role_display_name, ' ||
'granted_menu_data.menu_id menu_id, ' ||
'grantee_person.party_id party_id, ' ||
'grantee_person_company.party_id company_id, ' ||
'grantee_person_company.party_name company_name, ' ||
'trunc(grants.start_date) start_date , ' ||
'trunc(grants.end_date) end_date ' ||
'FROM fnd_grants grants, ' ||
'hz_parties grantee_person, ' ||
'hz_parties grantee_person_company, ' ||
'hz_relationships grantee_person_company_rel, ' ||
'fnd_menus_tl granted_menu, ' ||
'fnd_menus granted_menu_data, ' ||
'fnd_objects obj ' ||
'WHERE grants.object_id = obj.object_id ' ||
'AND grants.grantee_type = ''USER'' ' ||
'AND grantee_person.status = ''A'' ' ||
'AND grantee_person.party_type = ''PERSON'' ' ||
'AND grantee_person_company_rel.subject_type (+) = ''PERSON'' ' ||
'AND grantee_person_company_rel.subject_table_name (+) = ''HZ_PARTIES'' ' ||
'AND grantee_person_company_rel.object_table_name (+) = ''HZ_PARTIES'' ' ||
'AND grantee_person.party_id (+) = grantee_person_company_rel.subject_id ' ||
'AND grantee_person_company_rel.relationship_code(+) = ''EMPLOYEE_OF'' ' ||
'AND grantee_person_company_rel.status(+) = ''A'' ' ||
'AND grantee_person_company_rel.start_date(+) <= SYSDATE ' ||
'AND NVL(grantee_person_company_rel.end_date(+), SYSDATE+1) >= SYSDATE ' ||
'AND grantee_person_company.party_id (+) = grantee_person_company_rel.object_id ' ||
'AND grantee_person.party_id (+) = grantee_person_company_rel.subject_id ' ||
'AND grantee_person_company.status(+) = ''A'' ' ||
'AND grantee_person_company_rel.object_type(+) = ''ORGANIZATION'' ' ||
'AND grants.grantee_key like ''HZ_PARTY:%'' ' ||
'AND to_number(replace(grants.grantee_key,''HZ_PARTY:'','''')) = grantee_person.party_id ' ||
'AND substr(grants.grantee_key, 1, instr(grants.grantee_key, '':'')-1) =''HZ_PARTY'' ' ||
'AND nvl(grants.end_date, sysdate+1) >= trunc(sysdate) ' ||
'AND granted_menu.menu_id = grants.menu_id ' ||
'AND granted_menu.language= userenv(''LANG'') ' ||
'AND granted_menu.menu_id = granted_menu_data.menu_id ' ||
'AND ' ||
'( ' ||
'( ' ||
':1 is null ' ||
'AND granted_menu_data.menu_name like ''%'' ' ||
') ' ||
'OR ' ||
'( ' ||
'granted_menu_data.MENU_NAME in (:2) ' ||
') ' ||
') ' ||
'AND grants.instance_type=''SET'' ' ||
'AND ' ||
'( ' ||
'obj.obj_name =''EGO_ITEM'' ' ||
'AND ' ||
'( ' ||
' grants.instance_set_id in ( :3 ) ' ||
') ' ||
') ' ;
'SELECT ' ||
'grantee_group.party_name grantee_name, ' ||
'grantee_type grantee_type, ' ||
'granted_menu_data.menu_name role_name, ' ||
'granted_menu.user_menu_name role_display_name, ' ||
'granted_menu_data.menu_id menu_id, ' ||
'grantee_group.party_id party_id, ' ||
'-1 company_id, ' ||
'null company_name, ' ||
'trunc(grants.start_date) start_date , ' ||
'trunc(grants.end_date) end_date ' ||
'FROM fnd_grants grants, ' ||
'hz_parties grantee_group, ' ||
'fnd_menus_tl granted_menu, ' ||
'fnd_menus granted_menu_data, ' ||
'fnd_objects obj ' ||
'WHERE grants.object_id = obj.object_id ' ||
'AND grants.grantee_type = ''GROUP'' ' ||
'AND grants.grantee_key like ''HZ_GROUP:%'' ' ||
'AND grantee_group.party_type = ''GROUP'' ' ||
'AND grantee_group.status = ''A'' ' ||
'AND ' ||
'( ' ||
'grantee_group.party_id = -1000 ' ||
'OR EXISTS ' ||
'( ' ||
'SELECT ' ||
' ''X'' ' ||
'FROM fnd_grants f, ' ||
'fnd_menus m, ' ||
'fnd_objects o ' ||
'WHERE f.instance_pk1_value = to_char(grantee_group.party_id) ' ||
'AND f.start_date <= SYSDATE ' ||
'AND NVL(f.end_date, SYSDATE+1) >= SYSDATE ' ||
'AND f.menu_id = m.menu_id ' ||
'AND m.menu_name = ''EGO_MANAGE_GROUP'' ' ||
'AND f.object_id = o.object_id ' ||
'AND o.obj_name = ''EGO_GROUP'' ' ||
') ' ||
') ' ||
'AND to_number(replace(grants.grantee_key,''HZ_GROUP:'','''')) = grantee_group.party_id ' ||
'AND substr(grants.grantee_key, 1, instr(grants.grantee_key, '':'')-1) =''HZ_GROUP'' ' ||
'AND nvl(grants.end_date, sysdate+1) >= trunc(sysdate) ' ||
'AND granted_menu.menu_id = grants.menu_id ' ||
'AND granted_menu.language= userenv(''LANG'') ' ||
'AND granted_menu.menu_id = granted_menu_data.menu_id ' ||
'AND ' ||
'( ' ||
'( ' ||
':4 is null ' ||
'AND granted_menu_data.menu_name like ''%'' ' ||
') ' ||
'OR ' ||
'( ' ||
'granted_menu_data.MENU_NAME in ( :5 ) ' ||
') ' ||
') ' ||
'AND grants.instance_type=''SET'' ' ||
'AND ' ||
'( ' ||
'obj.obj_name =''EGO_ITEM'' ' ||
'AND ' ||
'( ' ||
' grants.instance_set_id in ( :6 ) ' ||
') ' ||
') ' ;
'SELECT ' ||
'grantee_company.party_name grantee_name, ' ||
' grantee_type grantee_type, ' ||
'granted_menu_data.menu_name role_name, ' ||
'granted_menu.user_menu_name role_display_name, ' ||
'grantee_company.party_id party_id, ' ||
'grantee_company.party_id company_id, ' ||
'grantee_company.party_name company_name, ' ||
'trunc(grants.start_date) start_date , ' ||
'trunc(grants.end_date) end_date ' ||
'FROM fnd_grants grants, ' ||
'hz_parties grantee_company, ' ||
'fnd_menus_tl granted_menu, ' ||
'fnd_menus granted_menu_data, ' ||
'fnd_objects obj ' ||
'WHERE grants.object_id = obj.object_id ' ||
'AND grants.grantee_type = ''COMPANY'' ' ||
'AND grants.grantee_key like ''HZ_COMPANY:%'' ' ||
'AND grantee_company.party_type = ''ORGANIZATION'' ' ||
'AND to_number(replace(grants.grantee_key,''HZ_COMPANY:'' , '''')) = grantee_company.party_id ' ||
'AND substr(grants.grantee_key, 1, instr(grants.grantee_key, '':'')-1) =''HZ_COMPANY'' ' ||
'AND nvl(grants.end_date, sysdate+1) >= trunc(sysdate) ' ||
'AND granted_menu.menu_id = grants.menu_id ' ||
'AND granted_menu.language= userenv(''LANG'') ' ||
'AND granted_menu.menu_id = granted_menu_data.menu_id ' ||
'AND grants.instance_type=''SET'' ' ||
'AND ' ||
'( ' ||
'obj.obj_name =''EGO_ITEM'' ' ||
'AND ' ||
'( ' ||
' grants.instance_set_id in ( ' || l_inst_set_ids || ' ) ' ||
') ' ||
') ' ;
'SELECT ' ||
'grantee_global.party_name grantee_name, ' ||
' grantee_type grantee_type, ' ||
'granted_menu_data.menu_name role_name, ' ||
'granted_menu.user_menu_name role_display_name, ' ||
'grantee_global.party_id party_id, ' ||
'-1 company_id, ' ||
'null company_name, ' ||
'trunc(grants.start_date) start_date, ' ||
'trunc(grants.end_date) end_date ' ||
'FROM fnd_grants grants, ' ||
'hz_parties grantee_global, ' ||
'fnd_menus_tl granted_menu, ' ||
'fnd_menus granted_menu_data, ' ||
'fnd_objects obj ' ||
'WHERE grants.object_id = obj.object_id ' ||
'AND grants.grantee_type = ''GLOBAL'' ' ||
'AND grantee_global.party_id = -1000 ' ||
'AND nvl(grants.end_date, sysdate+1) >= trunc(sysdate) ' ||
'AND granted_menu.menu_id = grants.menu_id ' ||
'AND granted_menu.language= userenv(''LANG'') ' ||
'AND granted_menu.menu_id = granted_menu_data.menu_id ' ||
'AND grants.instance_type=''SET'' ' ||
'AND ' ||
'( ' ||
'obj.obj_name =''EGO_ITEM'' ' ||
'AND ' ||
'( ' ||
' grants.instance_set_id in ( ' || l_inst_set_ids || ' ) ' ||
') ' ||
') ' ;
q1 := ' UNION SELECT grantee_person.party_name grantee_name, ' ||
' grantee_type grantee_type, ' ||
' granted_menu.menu_name role_name, ' ||
' granted_menu_tl.user_menu_name role_display_name, ' ||
' granted_menu.menu_id menu_id, ' ||
' grantee_person.PARTY_ID party_id , ' ||
' null company_id , ' ||
' '''' COMPANY_NAME , ' ||
' trunc(grants.start_date) start_date , ' ||
' trunc(grants.end_date) end_date ' ||
' FROM fnd_grants grants, ' ||
' fnd_menus granted_menu, ' ||
' fnd_objects obj, ' ||
' hz_parties grantee_person, ' ||
' fnd_menus_tl granted_menu_tl ' ||
' WHERE granted_menu.menu_id = grants.menu_id ' ||
' AND grants.instance_type = ''SET'' AND grants.instance_pk1_value = ''*NULL*''' ||
' AND grants.instance_set_id IN ( select instance_set.instance_set_id ' ||
' from fnd_object_instance_sets instance_set, mtl_system_items_b item ' ||
' where instance_set.object_id = grants.object_id and ' ||
' (instance_set.instance_set_name = ''EGO_ORG_ITEM_'' || ' ||
' to_char(item.organization_id) or instance_set.instance_set_name = ''EGO_ORG_CAT_ITEM_'' || ' ||
' to_char(item.organization_id) || ''_'' || to_char(item.ITEM_CATALOG_GROUP_ID)) ' ||
' and obj.obj_name = ''EGO_ITEM'' and item.inventory_item_id = ' || l_pk1_value || ' AND item.organization_id = ' || l_pk2_value ||
' AND grants.grantee_type =''USER'' ' ||
' AND grantee_person.party_type = ''PERSON'' ' ||
' AND grantee_person.status = ''A'' ' ||
' AND TO_NUMBER(REPLACE(grants.grantee_key,''HZ_PARTY:'','''')) = grantee_person.party_id ' ||
' AND grantee_key like ''HZ_PARTY:%'' ' ||
' AND (grants.start_date <= SYSDATE AND ( grants.end_date IS NULL OR SYSDATE <= grants.end_date )) ' ||
' AND grants.object_id = obj.object_id ' ||
' AND obj.obj_name = ''EGO_ITEM'') ' ||
' AND granted_menu_tl.menu_id = grants.menu_id ' ||
'AND granted_menu_tl.language= userenv(''LANG'') ' ||
'AND ' ||
'( ' ||
'( ' ||
l_role_name_temp || ' is null ' ||
'AND granted_menu.menu_name like ''%'' ' ||
') ' ||
'OR ' ||
'( ' ||
'granted_menu.MENU_NAME in ( ' || l_role_name_temp || ' ) ' ||
') ' ||
') ' ;
q2 := ' UNION SELECT grantee_group.party_name grantee_name, ' ||
' grantee_type grantee_type, ' ||
' granted_menu.menu_name role_name, ' ||
' granted_menu_tl.user_menu_name role_display_name, ' ||
' granted_menu.menu_id menu_id, ' ||
' grantee_group.PARTY_ID party_id , ' ||
' null company_id , ' ||
' '''' COMPANY_NAME , ' ||
' trunc(grants.start_date) start_date , ' ||
' trunc(grants.end_date) end_date ' ||
' FROM ' ||
' fnd_grants grants , ' ||
' fnd_menus granted_menu, ' ||
' fnd_objects obj , ' ||
' hz_parties member , ' ||
' hz_relationships member_group , ' ||
' hz_parties grantee_group, ' ||
' fnd_menus_tl granted_menu_tl ' ||
' WHERE grants.menu_id = granted_menu.menu_id ' ||
' AND grants.instance_type= ''SET'' AND grants.instance_pk1_value = ''*NULL*'' AND ' ||
' grants.instance_set_id IN ( select instance_set.instance_set_id from ' ||
' fnd_object_instance_sets instance_set, mtl_system_items_b item ' ||
' where instance_set.object_id = grants.object_id and (instance_set.instance_set_name = ''EGO_ORG_ITEM_'' || to_char(item.organization_id) ' ||
' or instance_set.instance_set_name = ''EGO_ORG_CAT_ITEM_'' || to_char(item.organization_id) || ''_'' || to_char(item.ITEM_CATALOG_GROUP_ID)) ' ||
' and obj.obj_name = ''EGO_ITEM'' AND item.inventory_item_id = ' || l_pk1_value || ' AND item.organization_id = ' || l_pk2_value ||
' AND grants.grantee_type = ''GROUP'' ' ||
' AND member_group.object_id = grantee_group.party_id ' ||
' AND member_group.subject_id = member.party_id ' ||
' AND member.party_type = ''PERSON'' ' ||
' AND member.status = ''A'' ' ||
' AND member_group.subject_type = ''PERSON'' ' ||
' AND member_group.object_type = ''GROUP'' ' ||
' AND member_group.relationship_type = ''MEMBERSHIP'' ' ||
' AND member_group.status = ''A'' ' ||
' AND member_group.start_date <= SYSDATE ' ||
' AND (member_group.end_date IS NULL OR member_group.end_date >= SYSDATE) ' ||
' AND TO_NUMBER(REPLACE(grants.grantee_key,''HZ_GROUP:'','''')) = grantee_group.party_id ' ||
' AND grantee_key like ''HZ_GROUP:%'' ' ||
' AND (grants.start_date <= SYSDATE AND (grants.end_date IS NULL OR SYSDATE <= grants.end_date)) ' ||
' AND grants.object_id = obj.object_id ' ||
' AND obj.obj_name = ''EGO_ITEM'') ' ||
' AND granted_menu_tl.menu_id = grants.menu_id ' ||
'AND granted_menu_tl.language= userenv(''LANG'') ' ||
'AND ' ||
'( ' ||
'( ' ||
l_role_name_temp || ' is null ' ||
'AND granted_menu.menu_name like ''%'' ' ||
') ' ||
'OR ' ||
'( ' ||
'granted_menu.MENU_NAME in ( ' || l_role_name_temp || ' ) ' ||
') ' ||
') ' ;
cursor_select := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cursor_select, query_to_exec || q1 || q2, DBMS_SQL.NATIVE);
dbms_sql.DEFINE_COLUMN(cursor_select, 1, '', 80);
dbms_sql.DEFINE_COLUMN(cursor_select, 2, '', 30);
dbms_sql.DEFINE_COLUMN(cursor_select, 3, '', 30);
dbms_sql.DEFINE_COLUMN(cursor_select, 4, '', 80);
dbms_sql.DEFINE_COLUMN(cursor_select, 5, l_temp_menu_id);
dbms_sql.DEFINE_COLUMN(cursor_select, 7, '', 80);
dbms_sql.DEFINE_COLUMN(cursor_select, 8, '', 30);
dbms_sql.DEFINE_COLUMN(cursor_select, 9, '', 80);
dbms_sql.DEFINE_COLUMN(cursor_select, 10, '', 30);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':1', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':2', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':3', l_inst_set_ids);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':4', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':5', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':6', l_inst_set_ids);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':7', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':8', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':9', l_role_name_temp);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':10', l_role_name_temp);
cursor_execute := DBMS_SQL.EXECUTE(cursor_select);
IF dbms_sql.fetch_rows(cursor_select) > 0 THEN
DBMS_SQL.COLUMN_VALUE(cursor_select, 1, l_grantee_list(l_index).grantee_name);
DBMS_SQL.COLUMN_VALUE(cursor_select, 2, l_grantee_list(l_index).grantee_type);
DBMS_SQL.COLUMN_VALUE(cursor_select, 3, l_grantee_list(l_index).role_name);
DBMS_SQL.COLUMN_VALUE(cursor_select, 4, l_grantee_list(l_index).role_display_name);
DBMS_SQL.COLUMN_VALUE(cursor_select, 5, l_temp_menu_id);
DBMS_SQL.CLOSE_CURSOR(cursor_select);
SELECT DISTINCT
sets.instance_set_id instance_set_id ,
sets.instance_set_name instance_set_name,
sets.predicate predicate
FROM fnd_grants grants,
fnd_object_instance_sets sets,
fnd_objects obj
WHERE obj.obj_name = p_obj_name
AND grants.object_id = obj.object_id
AND grants.instance_type='SET'
AND grants.parameter1 is null
AND nvl(grants.end_date, sysdate+1) >= trunc(sysdate)
AND grants.grantee_type = p_grantee_type
AND sets.instance_set_id = grants.instance_set_id
ORDER BY instance_set_name;
SELECT
DATABASE_OBJECT_NAME,
PK1_COLUMN_NAME,
PK2_COLUMN_NAME,
PK3_COLUMN_NAME,
PK4_COLUMN_NAME,
PK5_COLUMN_NAME
FROM fnd_objects
WHERE OBJ_NAME = p_obj_name;
cursor_select NUMBER;
obj_std_pkq := 'SELECT ' || obj_meta_data_rec.PK1_COLUMN_NAME;
query_to_exec := 'SELECT 1 from dual WHERE (' || p_obj_ids || ') IN (' || obj_std_pkq;
query_to_exec := 'SELECT 1 from dual WHERE EXISTS( ' || obj_std_pkq || ' WHERE ';
cursor_select := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cursor_select, query_to_exec, DBMS_SQL.NATIVE);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':id1', p_bind1);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':id2', p_bind2);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':id3', p_bind3);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':id4', p_bind4);
DBMS_SQL.BIND_VARIABLE(cursor_select, ':id5', p_bind5);
cursor_execute := DBMS_SQL.EXECUTE(cursor_select);
IF DBMS_SQL.FETCH_ROWS(cursor_select) > 0 THEN
IF i = 1 THEN
inst_set_ids := to_char(inst_set_preds_rec.instance_set_id);
DBMS_SQL.CLOSE_CURSOR(cursor_select);
SELECT COUNT(function_name)
INTO l_priv_count
FROM fnd_form_functions
WHERE function_name='EGO_ADD_ITEM_PEOPLE' AND
function_id IN (SELECT function_id FROM fnd_menu_entries WHERE menu_id = p_menu_id);
SELECT COUNT(function_name)
INTO l_priv_count
FROM fnd_form_functions
WHERE function_name='EGO_ADD_ITEM_DOCUMENT' AND
function_id IN (SELECT function_id FROM fnd_menu_entries WHERE menu_id = p_menu_id);
SELECT COUNT(function_name)
INTO l_priv_count
FROM fnd_form_functions
WHERE function_name='EGO_VIEW_ITEM_DOCUMENT_LIST' AND
function_id IN (SELECT function_id FROM fnd_menu_entries WHERE menu_id = p_menu_id);
SELECT PARTY_ID INTO l_party_id FROM EGO_USER_V WHERE user_name = FND_GLOBAL.USER_NAME;
SELECT PARTY_ID INTO l_party_id FROM EGO_USER_V WHERE user_id = TO_CHAR(FND_GLOBAL.User_Id);
SELECT
Nvl(fad.category_id,fd.category_id)
INTO
l_category_id
FROM
fnd_attached_documents fad,fnd_documents fd
WHERE
(p_attachment_id IS NULL OR fad.attached_Document_id = p_attachment_id)
AND (fad.entity_name = p_entity_name)
AND (fad.pk1_value = p_pk1_value)
AND (p_pk2_value IS NULL OR fad.pk2_value = p_pk2_value)
AND (p_pk3_value IS NULL OR fad.pk3_value = p_pk3_value)
AND (p_pk4_value IS NULL OR fad.pk4_value = p_pk4_value)
AND (p_pk5_value IS NULL OR fad.pk5_value = p_pk5_value)
AND fd.document_id = fad.document_id;
l_result := 'Update';
SELECT
item_catalog_group_id,
lifecycle_id,
current_phase_id
INTO
l_item_catalog_group_id,
l_lifecycle_id,
l_lifecycle_id
FROM
mtl_system_items_b
WHERE
inventory_item_id = p_pk2_value AND
organization_id = p_pk1_value;
THEN RETURN('Update');