0% found this document useful (0 votes)
26 views2 pages

API TO Create New USer IN EBS

This procedure creates new users by: 1. Looping through a cursor to fetch user details from two tables 2. Calling a createuser package to create the user with the fetched details like username, password, start date and email 3. Updating the user details table to mark the user creation process as completed 4. Handling exceptions by updating the error message if user creation fails
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

API TO Create New USer IN EBS

This procedure creates new users by: 1. Looping through a cursor to fetch user details from two tables 2. Calling a createuser package to create the user with the fetched details like username, password, start date and email 3. Updating the user details table to mark the user creation process as completed 4. Handling exceptions by updating the error message if user creation fails
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

API to Create new User

CREATE OR REPLACE PROCEDURE xxx_create_user_p

IS

l_password VARCHAR2 (30) := 'welcome123';

l_session_id NUMBER := USERENV ('sessionid');

l_err_msg VARCHAR2 (2000) := NULL;

CURSOR get_details

IS

SELECT audt.*, per.person_id

FROM xxx_user_details_t audt, per_people_x per

WHERE per.employee_number = audt.employee_number;

BEGIN

FOR fetch_details IN get_details

LOOP

BEGIN

fnd_user_pkg.

createuser (

x_user_name => fetch_details.user_name,

x_owner => NULL,

x_unencrypted_password => l_password,

x_session_number => l_session_id,

x_start_date => fetch_details.start_date,

x_end_date => NULL,

x_email_address => fetch_details.email_address);

UPDATE xxx_user_details_t audt

SET audt.process_flag = 'Y', err_msg = NULL


WHERE audt.user_name = fetch_details.user_name;

COMMIT;

EXCEPTION

WHEN OTHERS

THEN

l_err_msg := SQLERRM;

UPDATE xxx_user_details_t audt

SET audt.process_flag = 'N', err_msg = l_err_msg

WHERE audt.user_name = fetch_details.user_name;

COMMIT;

END;

END LOOP;

EXCEPTION

WHEN OTHERS

THEN

DBMS_OUTPUT.put_line ('Failed' || SUBSTR (SQLERRM, 1, 100));

-- ROLLBACK;

END;

You might also like