Search code examples
oracle-databaseplsqloracle-apextabular-form

Update Apex Tabular form with PLSQL


How can I update an Apex Tabular Form with pl/sql instead of using a multi-row update(MRU), is it even possible?

Thanks in advance.


Solution

  • Yes, it is possible. You can delete (or disable) the standard processes such as ApplyMRU, and replace them with your own PL/SQL processes to handle the tabular form arrays something like this:

    for i in 1..apex_application.g_f02.count loop
       update dept
       set    dname = apex_application.g_f03(i)
       where  deptno = apex_application.g_f02(i);
    end loop;
    

    However, it isn't simple and there is a fair bit you need to know to get this right, such as:

    • How the tabular form columns map to arrays like apex_application.g_f03 (view the page source and look for the names of the controls, e.g. "f03_0001").
    • How some item types like checkboxes a work differently to others
    • How to perform optimistic locking to prevent lost updates

    There used to be a "how to" document on apex.oracle.com that described this in detail, but I haven't been able to locate it recently.