I have an Interactive Report selecting all columns from a Table called ''Watch'' with a checkbox column:
APEX_ITEM.CHECKBOX(1,ID) AS Selected
I'm trying to update a table called ''description'' based on user checkbox selection:
DECLARE
V_TYPE VARCHAR2(100);
V_SOFT VARCHAR2(100);
V_ID VARCHAR2(100);
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
SELECT TYPE_OF_CHANGE
INTO V_TYPE
FROM WATCH WHERE ID = APEX_APPLICATION.G_F01(i);
SELECT REQUESTED_SOFT_MAPPING
INTO V_SOFT
FROM WATCH WHERE ID = APEX_APPLICATION.G_F01(i);
SELECT REP_ID
INTO V_ID
FROM WATCH WHERE ID = APEX_APPLICATION.G_F01(i);
--I have an If here cause there are several type of changes
IF V_TYPE = 'Soft Mapping' THEN
UPDATE DESCRIPTION
SET DESCRIPTION.SOFT_ASSIGNMENT = V_SOFT
WHERE DESCRIPTION.REP_ID = V_ID;
END IF;
END LOOP;
END;
If I run this...it times out. It keeps looping til it collapses. I noticed that the root of the issue most likely comes from the Where statement on the update block. Does anyone know how to prevent this ''infinite'' looping from happening?
Thanks
Aucun commentaire:
Enregistrer un commentaire