[SQL]系統function 變數

oracle system function variable 系統變數

FND_PROFILE.VALUE 是很常用的 Function, 整理起來以後就不需要翻書了

(資料來源 : User Guide)

 

USERNAME

Your user's current Oracle Application Object Library username.

USER_ID

Your user's current Oracle Application Object Library user ID.

RESP_ID

Your user's current responsibility ID.

APPL_SHRT_NAME

The short name of the application connected to your user's current responsibility.

RESP_APPL_ID

The application ID of the application connected to your user's current responsibility.

FORM_NAME

The name of the current form. Not available for concurrent programs.

FORM_ID

The form ID of the current form. Not available for concurrent programs.

FORM_APPL_NAME

The name of the application for which the current form is registered. Not available for concurrent programs.

FORM_APPL_ID

The application ID of the application for which the current form is registered. Not available for concurrent programs.

LOGON_DATE

Your user's logon date for the current session.

LAST_LOGON_DATE

Your user's logon date for the previous session.

LOGIN_ID

Your user's Sign–On Audit login ID in Oracle Application Object Library.

CONC_REQUEST_ID

Instance of your running current program. You can only use this profile option in a concurrent program. You use this profile option to fill the REQUEST_ID Who column.

CONC_PROGRAM_ID

The program ID associated with a running current program. You can only use this profile option in a concurrent program. You use this profile option to fill the PROGRAM_ID Who column.

CONC_PROGRAM_APPLICATION_ID

The application ID associated with a running current program. You can only use this profile option in a concurrent program. You use this profile option to fill the PROGRAM_APPLICATION_ID Who column.

CONC_LOGIN_ID

The login ID associated with a running concurrent program. You can only use this profile option in a concurrent program. You can use this profile option to fill the LAST_UPDATE_LOGIN Who column.

CONC_PRINT_OUTPUT

The value Yes or No that you enter in the Print Output field when you register a concurrent program. You can use the routine afpoput() from your concurrent programs to change the value of this profile option for a particular instance of your running concurrent program. This profile option determines whether the concurrent managers print the concurrent program's output to the printer.

CONC_PRINT_STYLE

The print style of your concurrent program's output that you enter in the Print Style field when you register a concurrent program. You can use the routine afpoput() from your concurrent programs to change the value of this profile option.

Hide Diagnostics menu entry

Yes/no Show or hide Help>>Diagnostics

 

FND_PROFILE and FND_GLOBAL values


[For more information, please visit http://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T462356.htm]

Following are the FND_PROFILE values that can be used in the PL/SQL code:

 

   fnd_profile.value('PROFILEOPTION');

   fnd_profile.value('MFG_ORGANIZATION_ID');

   fnd_profile.value('ORG_ID');

   fnd_profile.value('LOGIN_ID');

   fnd_profile.value('USER_ID');

   fnd_profile.value('USERNAME');

   fnd_profile.value('CONCURRENT_REQUEST_ID');

   fnd_profile.value('GL_SET_OF_BKS_ID');

   fnd_profile.value('SO_ORGANIZATION_ID');

   fnd_profile.value('APPL_SHRT_NAME');

   fnd_profile.value('RESP_NAME');

   fnd_profile.value('RESP_ID');


Following are the FND_GLOBAL values that can be used in the PL/SQL code:

 

   FND_GLOBAL.USER_ID;

   FND_GLOBAL.APPS_INTIALIZE;

   FND_GLOBAL.LOGIN_ID;

   FND_GLOBAL.CONC_LOGIN_ID;

   FND_GLOBAL.PROG_APPL_ID;

   FND_GLOBAL.CONC_PROGRAM_ID;

   FND_GLOBAL.CONC_REQUEST_ID;


 

For example, I almost always use the following global variable assignments in my package specification to use throughout the entire package body:

 

   g_user_id      PLS_INTEGER  :=  fnd_global.user_id;

   g_login_id     PLS_INTEGER  :=  fnd_global.login_id;

   g_conc_req_id  PLS_INTEGER  :=  fnd_global.conc_request_id;

   g_org_id       PLS_INTEGER  :=  fnd_profile.value('ORG_ID');

   g_sob_id       PLS_INTEGER  :=  fnd_profile.value('GL_SET_OF_BKS_ID');


And initialize the application environment as follows:

 

   v_resp_appl_id  := fnd_global.resp_appl_id;

   v_resp_id       := fnd_global.resp_id;

   v_user_id       := fnd_global.user_id;

    

   FND_GLOBAL.APPS_INITIALIZE(v_user_id,v_resp_id, v_resp_appl_id);