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