Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interactive Grid:Process with PL/SQL only that isn't based off a table

Tony FatourosNov 12 2019 — edited Nov 12 2019

Hi,

Env: Oracle APEX v5.1 with Oracle 12c Release 2

Hoping someone can provide some assistance with how to achieve the following. Firstly, I have created an Interactive Grid that isn't based off an underlying table as I will process this manually using PL/SQL.

I have been using the following as a guide: https://apex.oracle.com/pls/apex/germancommunities/apexcommunity/tipp/6361/index-en.html

I basically have the following query:

select

  level as id,

  level as grid_row,

  null as product,

  null as product_item

from dual connect by level <= 1

Concentrating on just the product and product_item columns where the product_item column will be a readonly column and only the product number can be entered, I would like to achieve the following:

Product
Product Item
123456123456-1
123456123456-2
556677556677-1
654321654321-1
654321654321-2
654321654321-3
123456123456-3

From the above, as the user types in the Product and then tabs out of the field, I would like a DA to fire that will add the sequence of "-1" to the end of that product number. Then is the user then adds another row within the IG and enters the same product number, I then want it to append "-2" to the end of it.

Only when the product changes number, I need the sequence to reset to "-1" for that new product as per 556677 and so forth.

Other scenarios that should also be taken into consideration are as follows:

  1. From above IG, the user entered 123456 again but this should calculate that the next sequence for 123456 is "-3"
  2. The same needs to be catered for, when a Product is removed from the IG but to always look at the max sequence number for that product.

I was thinking of possibly using APEX_COLLECTIONS as a means of storing what is currently in the grid, since no changes have been committed to the database.

Any help on the above would be great.

Thanks.

Tony.

Comments
Post Details
Added on Nov 12 2019
0 comments
270 views