Error in APEX_APPLICATION.G_F01 - ORACLE APEX

Asked

Viewed 74 times

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;

1 answer

-1

From what I understand the Checkboxes will be filled in if the collaborator is the application user. Test this code in textfield, for example. You should simulate these situations in other contexts, for example by making a insert in a test table to see if at least the code is running, and just not rendered on screen.

Here an excerpt from the book of Expert Oracle Application, 2nd Ed. about Checkboxes:

The Checkbox item was Different from the other items in APEX-its value was not submitted to the server for the Empty state. This Means that the array g_f01 would contain the values for checked items only; there was no really good way to get Around this problem. APEX 4 changed this for the Better by Introducing the Single Checkbox item. This item can be used

Browser other questions tagged

You are not signed in. Login or sign up in order to post.