Search code examples
oracle-databaseoracle-apexoracle-apex-5

Apex Search, place in holding area, repeat until submit


Yet another Apex question. I am using Apex 5, but suppose it will be similar for older apex versions.

I am basically trying to build a basic sales app that is taking stock out of a Table and adjusting the stock count accordingly.

It is a simple single search field that selects any column from a table and then displaying the result. P1_Search is the Plain text field and below the SQL query on the search which will return a Tabular form.

  select * from TABLE where regexp_like(NAME, :P1_SEARCH, 'i')
                         or regexp_like(BARCODE, :P1_SEARCH, 'i')
                         or regexp_like(STOCKCODE, :P1_SEARCH, 'i')
                         or regexp_like(DESCRIPTION, :P1_SEARCH, 'i')

This is all good and works for each of the columns.

Now the big question. Once I hit the search button I want to have a option to push a button or a text field for numeric values which should then add the selected item into a holding area in the bottom of the page. So if I search for "bread" I will find the result, select quantity one, or press a add button and this is where the issue comes in. Once I have completed a search for bread and selected it, I start a new search for "milk" which should not clear the selection below for "bread". Once I then have selected all my items and added to holding area, I want to hit a Checkout "button" which carries all the values over to the next page.

It is not for a online site, but an actual Point Of Sales system, so would prefer if I could stick with the apex portion. I have considered moving to external procedures where I can have a perl process running the hold until I submit, but I am trying to do this in Apex mostly and not use my favourite perl language :)


Solution

  • APEX Collections are a perfect fit for this scenario https://docs.oracle.com/cd/E14373_01/appdev.32/e11838/advnc.htm#HTMDB25878

    The are the 'global temporary tables' of the APEX world (logically, not physically.)