Monday, June 29, 2009

How can one set a profile option value without accessing the applications?

How can one set a profile option value without accessing the applications?

To set a profile option without accessing the applications, you need to use the SAVE function from FND_PROFILE package. It is NOT supported to update in the tables directly using the "update" statement.
As a test case, below is the detailed procedure of changing the "Guest User Password" profile option value to be profile option value to be GUEST/ORACLE.
This function takes the internal name of the profile option, while the name that appears in the Applications is the user friendly name, thus the internal name should be obtained first.


1. Obtain the internal name of the profile option using the following select statement as APPS:

SQL> select profile_option_name from fnd_profile_options_tl where user_profile_option_name like '';
e.g. For the "Guest User Password" profile option that has the internal name GUEST_USER_PWD

SQL> select profile_option_name from fnd_profile_options_tl where user_profile_option_name like 'Guest%';
PROFILE_OPTION_NAME--------------------GUEST_USER_PWD

Note that the user profile option name is case sensitive.
2. Use the following sample code to set the profile option to the required value:
===========Sample Code===========


DECLARE
\stat boolean;
BEGIN
dbms_output.disable;
dbms_output.enable(100000);
stat := FND_PROFILE.SAVE('GUEST_USER_PWD', 'GUEST/ORACLE', 'SITE');
IF stat THEN
dbms_output.put_line( 'Stat = TRUE - profile updated' );
ELSE
dbms_output.put_line( 'Stat = FALSE - profile NOT updated' );
END IF;
commit;
END;
===============End of Sample Code===============

For a description of the SAVE function parameters, use the specification below:

Function SAVE( X_NAME in varchar2, /* Profile name you are setting */ X_VALUE in varchar2, /* Profile value you are setting */ X_LEVEL_NAME in varchar2, /* Level that you're setting at: 'SITE','APPL','RESP','USER', etc. */ X_LEVEL_VALUE in varchar2 default NULL, /* Level value that you are setting at, e.g. user id for 'USER' level. X_LEVEL_VALUE is not used at site level. */ X_LEVEL_VALUE_APP_ID in varchar2 default NULL, /* Used for 'RESP' and 'SERVRESP' level; Resp Application_Id. */ X_LEVEL_VALUE2 in varchar2 default NULL /* 2nd Level value that you are setting at. This is for the 'SERVRESP' hierarchy. */ ) return boolean;

1 comment:

Unknown said...

once upon a time I have heard about a good way of database in recovery sql server 2000. hope it helps