Create User in Oracle apps with API
Steps To create USER in oracle apps using API
================================
Base table:
FND_USER
API:
FND_USER_PKG.CREATE_USER
DECLARE
================================
Base table:
FND_USER
API:
FND_USER_PKG.CREATE_USER
DECLARE
P_USER_NAME VARCHAR2(200) := '1111' ;
P_OWNER VARCHAR2(200) := NULL;
P_UNENCRYPTED_PASSWORD VARCHAR2(200) := 'oracle123';
P_SESSION_NUMBER NUMBER := userenv('sessionid');
P_START_DATE DATE := SYSDATE;
P_END_DATE DATE := NULL;
P_LAST_LOGON_DATE DATE := NULL;
P_DESCRIPTION VARCHAR2(200) := NULL;
P_PASSWORD_DATE DATE := SYSDATE - 1;
P_PASSWORD_ACCESSES_LEFT NUMBER := 1000;
P_PASSWORD_LIFESPAN_ACCESSES NUMBER := 1000;
P_PASSWORD_LIFESPAN_DAYS NUMBER := 1000;
P_EMPLOYEE_ID NUMBER := NULL;
P_EMAIL_ADDRESS VARCHAR2(200) := NULL;
P_FAX VARCHAR2(200) := NULL;
P_CUSTOMER_ID NUMBER := NULL;
P_SUPPLIER_ID NUMBER := NULL;
V_USER_ID NUMBER := NULL;
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 );
SELECT user_id
INTO v_user_id
FROM fnd_user
WHERE user_name = P_USER_NAME;
DBMS_OUTPUT.PUT_LINE ('User_id : ' ||V_USER_ID);
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line('Error while creating a user: '||sqlerrm);
END;
Comments
Post a Comment