set serveroutput on
Declare
lc_user_name VARCHAR2(100) := 'USER123';
lc_user_password VARCHAR2(100) := 'oracle123';
ld_user_start_date DATE := trunc(sysdate);
ld_user_end_date VARCHAR2(100) := NULL;
ld_password_date VARCHAR2(100) := trunc(sysdate);
ld_password_lifespan_days NUMBER := 90;
ln_person_id NUMBER := NULL;
lc_email_address VARCHAR2(100) := 'AJIT.KUMAR@injazat.com';
BEGIN
fnd_user_pkg.createuser
( x_user_name => lc_user_name,
x_owner => NULL,
x_unencrypted_password => lc_user_password,
x_start_date => ld_user_start_date,
x_end_date => ld_user_end_date,
x_password_date => ld_password_date,
x_password_lifespan_days => ld_password_lifespan_days,
x_employee_id => ln_person_id,
x_email_address => lc_email_address
);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/
BEGIN
fnd_user_pkg.addresp ('USER123','SYSADMIN','SYSTEM_ADMINISTRATOR','STANDARD','Add Responsibility to USER using pl/sql',SYSDATE,SYSDATE + 100);
commit;
dbms_output.put_line('Responsibility Added Successfully');
exception
WHEN others THEN
dbms_output.put_line(' Responsibility is not added due to ' || SQLCODE || substr(SQLERRM, 1, 100));
ROLLBACK;
END;
No comments:
Post a Comment