Thursday, July 21, 2016

Oracle eBusiness Suite R12: Initialize Application Context to debug SQLs inside a Concurrent program

Oracle concurrent programs initializes application context before running the actual code. Therefore, if we take out the SQLs from the concurrent program code (PLSQL or Reports) and execute in the development tools like Toad or SQL Developer, the results could be different. It could be due to 3 different kind of context variables

i.  NLS Context variables:- Many language specific views (Eg:- FND_FLEX_VALUES_VL) will be deepndendent on the the NLS language context variable.

ii. Multi Org context variables :- Org specific synonyms(Eg:-PO_HEADERS) in R12 will not return any data unless we initialize the Multi Org context variables.

iii.Security Context variables:- Access to many Application Object library features (Eg:- Profile option values) is possible only after setting the fnd_global security variables (user_id, responsibility_id etc)

The below script accepts concurrent request id as input and initializes the context variables accordingly. The intialized values can be found in DBMS OUTPUT.

1 comment:

Biranchi said...

Really an useful one while debugging any Incidents/defects/support tickets.
keep posting Binu. Good work!