DECLARE
lv_user_name VARCHAR2(100):= 'SANDEEP';
lv_owner VARCHAR2(10) := 'CUST';
lv_password VARCHAR2(20) := 'Oracle123';
ln_user_id NUMBER;
BEGIN
/*Create FND User*/
BEGIN
SELECT user_id
INTO ln_user_id
FROM fnd_user
WHERE user_name=lv_user_name;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('Did not create user('||lv_user_name||') : '||sqlerrm);
END;
fnd_user_pkg.updateuser
( x_user_name =>lv_user_name,
x_owner =>lv_owner,
x_unencrypted_password =>lv_password
);
IF ln_user_id IS NOT NULL THEN
dbms_output.put_line('Successfully Updated user password : '||lv_user_name);
dbms_output.put_line('user id = '||ln_user_id);
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in Create user :'||lv_user_name||'>>'||SQLERRM);
END;
lv_user_name VARCHAR2(100):= 'SANDEEP';
lv_owner VARCHAR2(10) := 'CUST';
lv_password VARCHAR2(20) := 'Oracle123';
ln_user_id NUMBER;
BEGIN
/*Create FND User*/
BEGIN
SELECT user_id
INTO ln_user_id
FROM fnd_user
WHERE user_name=lv_user_name;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('Did not create user('||lv_user_name||') : '||sqlerrm);
END;
fnd_user_pkg.updateuser
( x_user_name =>lv_user_name,
x_owner =>lv_owner,
x_unencrypted_password =>lv_password
);
IF ln_user_id IS NOT NULL THEN
dbms_output.put_line('Successfully Updated user password : '||lv_user_name);
dbms_output.put_line('user id = '||ln_user_id);
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in Create user :'||lv_user_name||'>>'||SQLERRM);
END;
No comments:
Post a Comment