1. To set org context to any specific single org:
BEGIN
MO_GLOBAL.SET_POLICY_CONTEXT('S', <orgid>);
END;
2. To set the mo security profile so that sqlplus will have same org context as given responsibility
DECLARE
l_resp_id number;
l_user_id number;
l_org_id number;
l_resp_appl_id number;
BEGIN
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name LIKE '&USER_NAME';
SELECT responsibility_id, application_id
INTO l_resp_id
FROM FND_RESPONSIBILITY_TL a
WHERE responsibility_name LIKE '&responsibility_name'
AND language = USERENV('LANG');
mo_global.init ('AR');
fnd_global.apps_initialize ( l_user_id
, l_resp_id
, l_resp_appl_id) ; -- pass in user_id, responsibility_id and application_id
mo_global.set_policy_context ('S', l_org_id);
END;
/
BEGIN
MO_GLOBAL.SET_POLICY_CONTEXT('S', <orgid>);
END;
2. To set the mo security profile so that sqlplus will have same org context as given responsibility
DECLARE
l_resp_id number;
l_user_id number;
l_org_id number;
l_resp_appl_id number;
BEGIN
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name LIKE '&USER_NAME';
SELECT responsibility_id, application_id
INTO l_resp_id
FROM FND_RESPONSIBILITY_TL a
WHERE responsibility_name LIKE '&responsibility_name'
AND language = USERENV('LANG');
mo_global.init ('AR');
fnd_global.apps_initialize ( l_user_id
, l_resp_id
, l_resp_appl_id) ; -- pass in user_id, responsibility_id and application_id
mo_global.set_policy_context ('S', l_org_id);
END;
/
No comments:
Post a Comment