FND User UPDATE API Script
DECLARE
CURSOR get_details
IS
SELECT *
FROM ptl_user_stg
WHERE status IS NULL AND sno <=1;
v_user_name VARCHAR2 (30);
v_resp VARCHAR2 (30);
v_resp_key VARCHAR2 (30);
v_app_short_name VARCHAR2 (50);
v_email_address VARCHAR2 (100);
l_err_msg VARCHAR2 (2500) := NULL;
BEGIN
FOR fetch_details IN get_details
LOOP
v_resp_key := NULL;
v_app_short_name := NULL;
BEGIN
fnd_user_pkg.updateuser (x_user_name => v_user_name,
x_owner => NULL,
x_unencrypted_password => NULL,
x_session_number => 0,
x_start_date => NULL,
x_end_date => SYSDATE,
x_last_logon_date => NULL,
x_description => NULL,
x_password_date => NULL,
x_password_accesses_left => NULL,
x_password_lifespan_accesses => NULL,
x_password_lifespan_days => NULL,
x_employee_id => NULL,
x_email_address => NULL,
x_fax => NULL,
x_customer_id => NULL,
x_supplier_id => NULL,
x_user_guid => NULL,
x_change_source => NULL
);
UPDATE ptl_user_stg
SET status = 'S',
error_msg = NULL
WHERE user_name = fetch_details.user_name;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
UPDATE ptl_user_stg
SET status = 'E',
error_msg = l_err_msg
WHERE user_name = fetch_details.user_name;
COMMIT;
END;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
DBMS_OUTPUT.put_line ('Main Exception: ' || l_err_msg);
END;
No comments:
Post a Comment