This example sends 100 concurrents "ACTIVE USERS" for testing.
DECLARE
G_APPLICATION_ID NUMBER;
G_APPLICATION_NAME VARCHAR2(250);
G_APPLICATION_SHORT_NAME VARCHAR2(10) := 'FND';
G_RESP_ID NUMBER;
G_USER_ID NUMBER;
G_USER_NAME VARCHAR2(400);
V_REQUEST_ID NUMBER;
BEGIN
SELECT FA.APPLICATION_ID, FAT.APPLICATION_NAME
INTO G_APPLICATION_ID, G_APPLICATION_NAME
FROM FND_APPLICATION_TL FAT, FND_APPLICATION FA
WHERE FAT.APPLICATION_ID = FA.APPLICATION_ID
AND FAT.LANGUAGE = 'US'
AND FA.APPLICATION_SHORT_NAME = G_APPLICATION_SHORT_NAME;
G_USER_ID := 0;
G_USER_NAME := 'SYSADMIN';
BEGIN
SELECT RESPONSIBILITY_ID
INTO G_RESP_ID
FROM FND_RESPONSIBILITY
WHERE RESPONSIBILITY_KEY = 'SYSTEM_ADMINISTRATOR';
EXCEPTION
WHEN OTHERS THEN
G_RESP_ID := -1;
END;
FND_GLOBAL.APPS_INITIALIZE(G_USER_ID, G_RESP_ID, 1);
DBMS_SESSION.SET_NLS('NLS_TERRITORY', 'BRAZIL');
FOR I IN 1 .. 100 LOOP
V_REQUEST_ID := FND_REQUEST.SUBMIT_REQUEST('FND',
'FNDSCURS',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
IF V_REQUEST_ID < 1 THEN
RAISE NO_DATA_FOUND;
END IF;
END LOOP;
COMMIT;
END;
/
Comentários
Postar um comentário