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