EBS fnd_global.apps_initialize的使用

scu2005發表於2009-11-19

原型:fnd_global.apps_initialize(user_ID, Responsibility_id,
                                         Responsibility_application_id);
 
作用:在資料庫的會話中設定全域性變數,和使用者概要資訊。

關於在oracle客戶端正確取道PROFILE值的解決辦法:fnd_global.APPS_INITIALIZE的說明

首先找到三個引數的值:
user_id ,resp_id ,resp_appl_id

select user_id from fnd_user where user_name ='yourusername'

select RESPONSIBILITY_ID,APPLICATION_ID from fnd_responsibility where RESPONSIBILITY_KEY=yourrespkey ;

然後:執行
BEGIN
fnd_global.APPS_INITIALIZE(user_id => youruesr_id ,esp_id => yourresp_id,resp_appl_id =>yourresp_appl_id);
END;

這樣就可以得到值正確的值了:
select fnd_profile.value('GL_SET_OF_BKS_ID') FROM DUAL;

引數獲得:
  引數一,使用者號
    select user_id
    from fnd_user
    where user_name like '%OPERATIONS%'; -- ID of OPERATIONS:1318
 
  引數二,職責編號(responsibility id)
    select RESPONSIBILITY_ID, APPLICATION_ID, RESPONSIBILITY_KEY
    from fnd_responsibility
    --where APPLICATION_ID = 140
    where RESPONSIBILITY_KEY like '%ASSETS_VISION_OPERATIONS%';
 
  引數三,代表該職責所屬的應用程式(application)的編號
    上面的SQL取得
 
執行:
BEGIN
  fnd_global.APPS_INITIALIZE(youruesr_id, yourresp_id, yourresp_appl_id);
END;
 
測試:
  select fnd_profile.value('GL_SET_OF_BKS_ID') FROM DUAL;
  fnd_profile.value('USER_ID') --對應剛才的user_id
)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11536986/viewspace-620038/,如需轉載,請註明出處,否則將追究法律責任。

相關文章