In the past I was able to loop in a PL/SQL Script and, inside that loop provide values parameters that I used to invoke a Projection to perform some action in Bulk. Here is one example:
-- Use IFS API repeatedly to perform some action
DECLARE
err_code INT;
err_msg VARCHAR(512);
issue_number SMALLINT := '5189';
CountryCode_ VARCHAR2(32000) := 'AR';
StateCode_ VARCHAR2(32000) := 'CATA';
CountyCode_ VARCHAR2(32000) := '10523';
ETag_ VARCHAR2(32000) := 'W/"AAASGyAAMAAAQjVAAZ:20260107063806"';
Action$_ VARCHAR2(32000) := 'DO';
Return_$_ COUNTIES_HANDLING_SVC.ENTITY_DEC := null;
BEGIN
FND_SESSION_API.SET_PROPERTY('ODP_SESSION', 'TRUE');
FOR county_code_delete_rec IN (
SELECT COUNTRY_CODE, STATE_CODE, COUNTY_CODE, 'W/"' || OBJID || ':' || OBJVERSION ETAG
FROM COUNTY_CODE
WHERE COUNTRY_CODE = 'AR'
AND ROWNUM <= 10 -- do this in batches
ORDER BY COUNTRY_CODE, STATE_CODE, COUNTY_CODE
) LOOP
CountryCode_ := county_code_delete_rec.COUNTRY_CODE;
StateCode_ := county_code_delete_rec.STATE_CODE;
CountyCode_ := county_code_delete_rec.COUNTY_CODE;
ETag_ := county_code_delete_rec.ETAG;
Action$_ := 'DO';
BEGIN
Return_$_ := Counties_Handling_SVC.CRUD_Delete(ETag_, CountryCode_, StateCode_, CountyCode_, Action$_, county_code## => '');
INSERT INTO MANUAL_CHANGES_LOG (issue_number, text) VALUES (issue_number, 'Deleted row: COUNTRY_CODE: ' || CountryCode_ || ', STATE_CODE: '|| StateCode_ || ', COUNTY_CODE: ' || CountyCode_);
EXCEPTION
WHEN OTHERS THEN
err_code := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 200);
IF err_code = -20110 THEN
INSERT INTO MANUAL_CHANGES_LOG (issue_number, text) VALUES (issue_number, 'ERROR ' || err_code || ' - ' || err_msg || 'when deleting County entry with COUNTRY_CODE: ' || CountryCode_ || ', STATE_CODE: '|| StateCode_ || ', COUNTY_CODE: ' || CountyCode_);
ELSE
INSERT INTO MANUAL_CHANGES_LOG (issue_number, text) VALUES (issue_number, 'ERROR ' || err_code || ' - ' || err_msg || 'when deleting County entry with COUNTRY_CODE: ' || CountryCode_ || ', STATE_CODE: '|| StateCode_ || ', COUNTY_CODE: ' || CountyCode_);
END IF;
END;
END LOOP;
FND_SESSION_API.SET_PROPERTY('ODP_SESSION', 'FALSE');
END;Now, when running a script like this I see Oracle fails on calling the CRUD_Delete with the error message “ERROR -20114 - ORA-20114: CountyCode.FND_MODIFIED: The County Code record has already been changed. Please refresh the record and reenter your changes”.
Any idea why can be wrong




