0
I have a problem with this script below:
I have a checkbox on my page ( not in report, on the same page, a page item) and I would like the same when clicking and pressing a Ubmit button to perform the script procedure, but it does the process but does not return anything. I believe the problem is in the LOOP of APEX_APPLICATION.G_F01 . Someone can help me with this?
DECLARE
V_DS_COLAB VARCHAR2(50);
BEGIN
APEX_DEBUG.MESSAGE('CHECK:'|| vCHECK);
FOR A IN 1 .. APEX_APPLICATION.G_F01.COUNT LOOP
BEGIN
SELECT C.DS_COLABORADOR INTO V_DS_COLAB FROM COLABORADOR C WHERE C.USER_APEX = V('APP_USER') ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20001,'NENHUM REGISTRO ENCONTRADO!');
WHEN TOO_MANY_ROWS THEN
RAISE_APPLICATION_ERROR(-20002,'MAIS QUE UM REGISTRO ENCONTRADO!');
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20003,'ERRO NAO PREVISTO' || SQLERRM) ;
END;
:P12_SUPER := (V_DS_COLAB || ' - ' || TO_CHAR(SYSDATE,'DD/MM/RRRR HH24:MI'));
UPDATE COMPETENCIA_COLABORADOR CC SET FINALIZADO_SN = 'S'
WHERE CC.CD_EQUIPE = :P12_EQUIPE
AND CC.CD_COMPETENCIA = (SELECT C.CD_COMPETENCIA
FROM COMPETENCIA C
WHERE TO_DATE(LPAD(C.MES_COMPETENCIA,2,'0') || '/' || C.ANO_COMPETENCIA,'MM/RRRR') = TO_DATE(:P12_COMPETENCIA,'MM/RRRR'));
END LOOP;
END;