SET SERVEROUTPUT ON SIZE UNLIMITED;
DECLARE
l_success BOOLEAN;
CURSOR uid IS
SELECT DISTINCT fpov.level_value AS user_id
FROM fnd_profile_option_values fpov
JOIN fnd_profile_options fpo ON fpov.profile_option_id = fpo.profile_option_id
WHERE fpo.profile_option_name = 'ICX_FORMS_LAUNCHER'
AND fpov.level_id = 10004 -- User level
AND fpov.profile_option_value IS NOT NULL;
v_counter NUMBER := 0; -- Counter for users processed
BEGIN
FOR i IN uid LOOP
l_success := FND_PROFILE.save(
'ICX_FORMS_LAUNCHER',
'http://xxx.xxxx.xxx:8000/forms/frmservlet?config=jws',
'USER',
i.user_id
);
v_counter := v_counter + 1;
IF MOD(v_counter, 100) = 0 THEN -- Print output every 100 users to avoid overflow
DBMS_OUTPUT.PUT_LINE(v_counter || ' users updated...');
END IF;
COMMIT; -- Commit after each update
END LOOP;
DBMS_OUTPUT.PUT_LINE('Profile update completed successfully.');
END;
/