How to Set MOAC Context in R12i (MOAC - Enabled)
All the context-based views like
1. OE_ORDER_HEAREDS
2. OE_ORDER_LINES
3. PO_HEADERS
4. PO_LINES etc has been replaced with Synonym.
Now on if user want to set the context to get the data for particular operating unit they need to use the new apis to set the context
The new API to set the context in R12 is
MO_GLOBAL.Set_Policy_Context.
Note - I like this book and that is my personal opinion.Someone else may or may not like it.
This API has 2 parameters
1. Operating unit
2. Context
Context has 2 values
1. M
2. S
When policy context is set to ‘M’, data from all accessible Operating Units will be returned.
When policy context is set to ‘S’, then only data from the specified Org_Id will be returned.
Example for R12 –
· Try to run
select * from oe_order_headers
· Set the Context
begin
MO_GLOBAL.Set_Policy_Context('S',204);
end;
· Run Again
· select * from oe_order_headers
But for R11i it is still the same
· Set Context
begin
dbms_application_info.set_client_info('204');
end;
· Run Query
· select * from oe_order_headers