更新指定USER Name的資料
DECLARE
v_user_name VARCHAR2(100) := 'TEST'; --輸入USER NAME
v_user_password VARCHAR2(100) := '123';
v_user_start_date DATE := TO_DATE('30-JUN-2014');
v_user_end_date VARCHAR2(100) := NULL;
v_password_date VARCHAR2(100) := TO_DATE('30-JUN-2014');
v_password_life_days NUMBER := 90; --密碼存活的天數
v_person_id NUMBER := 1230;
v_email_address VARCHAR2(100) := 'test@test.com';


BEGIN
fnd_user_pkg.updateuser
( x_user_name => v_user_name,
x_owner => NULL,
x_unencrypted_password => v_user_password,
x_start_date => v_user_start_date,
x_end_date => v_user_end_date,
x_password_date => v_password_date,
x_password_life_days => v_password_lifespan_days,
x_employee_id => v_person_id,
x_email_address => v_email_address
);

COMMIT;

EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;


=================================================================================

新增USER
DECLARE
v_user_name VARCHAR2(100) := 'TEST';
v_user_password VARCHAR2(100) := '123456';
v_user_start_date DATE := TO_DATE('30-JUN-2014');
v_user_end_date VARCHAR2(100) := NULL;
v_password_date VARCHAR2(100) := TO_DATE('30-JUN-2014');
v_password_life_days NUMBER := 90;
v_person_id NUMBER := 1230;
v_email_address VARCHAR2(100) := 'TEST@test.com';

BEGIN
fnd_user_pkg.createuser
( x_user_name => v_user_name,
x_owner => NULL,
x_unencrypted_password => v_user_password,
x_start_date => v_user_start_date,
x_end_date => v_user_end_date,
x_password_date => v_password_date,
x_password_lifes_days => v_password_lifespan_days,
x_employee_id => v_person_id,
x_email_address => v_email_address
);

COMMIT;

EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;


======================================================================================


BEGIN
fnd_user_pkg.CHANGE_USER_NAME
( x_old_user_name => 'test',
x_new_user_name => 'test01'
);

COMMIT;

EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;

arrow
arrow
    全站熱搜

    keven 發表在 痞客邦 留言(0) 人氣()