Skip to Main Content
Feature Request FR-2520
Product Area Page Components
Status CLOSED

10 Voters

The POST-QUERY trigger analog for IR/IG

yuri_slutsky Public
· May 16 2022

Idea Summary
As a Oracle Forms programmer I think the biggest hurdle to upgrade Forms to Apex is the lack of  the POST-QUERY trigger analog in IR/IG.

Use Case
Adding a point where the developer can set values for columns/write the some code during a select for each row

Preferred Solution (Optional)
Create a new dynamic action for IR/IG as oracle apex row initialization event for IG, but it's not a new row only for  where I can set value for any column based on other columns of a query. This action works on the fly the query duration.

This is a great idea! You can already achieve this in APEX today with a slightly different approach.

Comments

Comments

  • zolo OP 3.3 years ago

    POST-QUERY-like operation can be useful for any item where a lot of data needs to be displayed (eg cards region) by paging or scrolling, where we only want to do something with the sorted items.

  • monica.godoy Admin OP 3.3 years ago

    Hi Yuri,
    Let me explain to you with an example of how to accomplish this with APEX.
    This is a sample form with a POST-QUERY trigger. The purpose of this trigger is to fetch the description of the product name:

    Using an Interactive Report, you can use a List of Values to fetch the description for each product name.

    And you wouldn't need a POST-QUERY trigger in your Interactive Report or Interactive Grid:

    Please read more: Modernizing an Oracle Forms Application to an Oracle APEX Application
    And the sample Summit App.

    Regarding the use case you mentioned: “_Adding a point where the developer can set values for columns/write the some code during a select for each row_”. You can set values for columns working directly with the SQL Query you need for your Interactive Report/Interactive Grid or even call functions if needed.

    Regards,
    Mónica

  • yuri_slutsky OP 3.3 years ago

    The POST-QUERY trigger's has a larger purpose than setting a description for a code or setting a value for a calculated column. How about setting some columns depending on other columns. In short, there is a need to call a procedure and not a function. This is important and this is not now. Else I need to perform a loop in a javascript function for IG model and I don't know how I can do that in IR.

  • monica.godoy Admin OP 3.3 years ago

    Hi Yuri,

    Right, that was just an example.
    Could you please enumerate all the use cases, so we can suggest the best approach in APEX?

    Thanks.

  • yuri_slutsky OP 3.2 years ago

    That isn't a great sample of code but sometimes I need to code a procedure for each query row with several output parameters to set several page items.

    Case 1:

          SELECT P.KOD_PNIYA, V.TEUR, P.STATUS_PNIYA, P.STATUS_PNIYA, P.TSHUVA
           INTO :KOD_PNIYA, :DESC, :STATUS
    :OLD_STATUS, :RESPND_OLD
           FROM TVKOD_UM1 V, TSTPNIYOT_UM1 P
          WHERE P.MIS_STUDENT = :MIS_STUDENT
            AND P.MISPAR_PNIYA = :MISPAR_PNIYA_MENAHEL
            AND V.MIS_TAVLA = '1040'
            AND V.KOD = P.KOD_PNIYA
            AND ROWNUM = 1;
    I understand I candivide this select to several selects, but…

    Case 2:

          SEL_PARMS_EXTRA_DATA(MISPAR_PNIYA_MENAHEL,
                              :TEUR_NETUNIM_NOSAFIM_1,
    :TEUR_NETUNIM_NOSAFIM_2,
    :TEUR_NETUNIM_NOSAFIM_3,
    :TEUR_NETUNIM_NOSAFIM_4,
    :TEUR_NETUNIM_NOSAFIM_5,
    :TEUR_NETUNIM_NOSAFIM_6,
    :TEUR_NETUNIM_NOSAFIM_7,
    :TEUR_NETUNIM_NOSAFIM_8,
    :TEUR_NETUNIM_NOSAFIM_9,
    :TEUR_NETUNIM_NOSAFIM_10);
    The procedure set several page items according IN PARAMETER MISPAR_PNIYA_MENAHEL

    Case 3 

    The procedure SEL_PARMS_EXTRA_DATA performs loop from another table and calculate something and put out parameters

  • monica.godoy Admin OP 3.2 years ago

    Hi Yuri,

    For case 1, we don't need to set the value of the columns, just provide the SQL query you need.
    Please see this demo app: FR-2520
    If the SQL query returns only one row, you would use a Form region and set the value of the items.

    For case 2, the setting item value is for one row or multiple rows?
    Keep in mind that you can use APEX_COLLECTION to temporarily store the data.

    For case 3, I don't fully understand the case but it probably this procedure has to save some data that then you can query.

    Hope it helps.

  • yuri_slutsky OP 3.2 years ago

    Hi Monica,

    I'm sorry, Case 3 is the explanation of Case 2.
    I agree, I can use collections and join it always. That's I do it.
    About Case 1, usage a procedure for each row:
    Reason 1: The procedure used for encapsulation of a logic
    Reason 2: The procedure has several IN parameters(columns of the row) and several OUT parameters(columns of the row). Let's add to it that there's in procedure exists complex logic(loops and select from other tables) I can't to code in the main select. If to do that in collections then it needs join with all IN parameters and to select  the same query twice.

    In short, I think it's not low code.

    I see something like that:

    Thanks

  • yuri_slutsky OP 3.2 years ago

    In addition, you should know that the inability to simply implement this trigger is the biggest obstacle for a simple upgrade Oracle Forms to APEX.

    The other triggers' logic I can use in validations, dynamic actions...