Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

May 27, 2005

Oracle Applications Session Set Up

Just a quick note to myself, as I'm always forgetting how to establish my application credentials in SQL sessions. Running this script sets the appropriate (database) session variables for you to use the translated and organisation specific objects;

DECLARE
  l_application_id NUMBER := 0;
  l_responsibility_id NUMBER := 0;
  l_user_id NUMBER := 0;

  l_org_id NUMBER := <Your ORG Id>;
  l_sob_id NUMBER := <Your Set of Books Id>;

BEGIN
  dbms_application_info.set_client_info(to_char(l_org_id));

  SELECT user_id
  INTO   l_user_id
  FROM   fnd_user aa
  WHERE  user_name = <Your applications user name>;

  SELECT application_id, responsibility_id
  INTO   l_application_id, l_responsibility_id
  FROM   fnd_responsibility_tl
  WHERE  responsibility_name= <Your applications responsibility name>;

  fnd_global.APPS_INITIALIZE( l_user_id,
     l_responsibility_id,
     l_application_id,
     0,-1 );
  fnd_profile.put('ORG_ID', l_org_id);
  fnd_profile.put('SET_OF_BOOKS', l_sob_id);
END;

Posted by Andy Todd at May 27, 2005 10:28 AM

Comments