Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Sunday, May 27, 2012

API’s to Create User from backend in oracle



Using the below query, you can create a User in Oracle application.Just pass username, password and email id as parameters and it will create a user.

DECLARE
   v_user_name    VARCHAR2 (30) := UPPER ('&Enter_User_Name');
   v_password     VARCHAR2 (30) := '&Enter_Password';
   v_session_id   INTEGER := USERENV ('sessionid');
   v_email        VARCHAR2 (30) := UPPER ('&Enter_Email_Id');
BEGIN
   fnd_user_pkg.createuser (x_user_name              => v_user_name,
                            x_owner                  => NULL,
                            x_unencrypted_password   => v_password,
                            x_session_number         => v_session_id,
                            x_start_date             => SYSDATE,
                            x_end_date               => NULL,
                            x_email_address          => v_email);
   COMMIT;
   DBMS_OUTPUT.put_line ('User:' || v_user_name || 'Created Successfully');
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (
            'Unable to create User due to'
         || SQLCODE
         || ' '
         || SUBSTR (SQLERRM, 1, 100));
      ROLLBACK;

END;

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect