Oracle Apps Script to create a new User Login Account:
- -- CREATE a new user account
- DECLARE
- P_user_name VARCHAR2 (200): ='Ptiany';
- P_owner VARCHAR2 (200): =NULL;
- P_unencrypted_password VARCHAR2 (200): ='Welcome';
- P_session_number NUMBER: = USERENV ('Sessionid');
- P_start_dateDATE: = SYSDATE;
- P_end_dateDATE: =NULL;
- P_last_logon_dateDATE: =NULL;
- P_description VARCHAR2 (200): ='Pan tiany';
- P_password_dateDATE: = SYSDATE;
- P_password_accesses_left NUMBER: =NULL;
- P_password_lifespan_accesses NUMBER: =NULL;
- P_password_lifespan_days NUMBER: =NULL;
- P_employee_id NUMBER: =NULL;
- P_email_address VARCHAR2 (200): ='Tianpan @ gmail.com';
- P_fax VARCHAR2 (200): =NULL;
- P_customer_id NUMBER: =NULL;
- P_supplier_id NUMBER: =NULL;
- V_user_id NUMBER;
- BEGIN
- --
- --
- Fnd_user_pkg.createuser
- (X_user_name => p_user_name,
- X_owner => p_owner,
- X_unencrypted_password => p_unencrypted_password,
- X_session_number => p_session_number,
- X_start_date => p_start_date,
- X_end_date => p_end_date,
- X_last_logon_date => p_last_logon_date,
- X_description => p_description,
- X_password_date => p_password_date,
- X_password_accesses_left => p_password_accesses_left,
- X_password_lifespan_accesses => p_password_lifespan_accesses,
- X_password_lifespan_days => p_password_lifespan_days,
- X_employee_id => p_employee_id,
- X_email_address => p_email_address,
- X_fax => p_fax,
- X_customer_id => p_customer_id,
- X_supplier_id => p_supplier_id
- );
- --
- --
- SELECTUser_id
- INTOV_user_id
- FROMFnd_user
- WHEREUser_name = p_user_name;
- --
- DBMS_OUTPUT.put_line ('User _ id :'| V_user_id );
- --
- COMMIT;
- --
- EXCEPTION
- WHENOTHERSTHEN
- --
- DBMS_OUTPUT.put_line ('Error while creating a user :'| SQLERRM );
- --
- END;
The newly created User has not been assigned any accusations, and appropriate responsibilities need to be assigned under Sys admin.