How to enter an indefinite number of digital beaches.

Hello:

I need to create a form of APEX that allows the user to enter several digital beaches, for example,
10 - 24
88 - 134
567 - 568
853-861
911 - 917

But the number of channels may be undefined. It could be a lot.
So, I have to write code that takes each of these ranges and uses them as lower and upper of a FOR LOOP limits and performs an UPDATE for each of the iterations.

The part of the FOR LOOP is easy to do, but I don't know how to allow the user to enter an indefinite number of digital beaches and then scroll through these ranges so that I can run the FOR-each LOOP.
What I really need to create a very large number of items of text on the form, to reflect where multiple lines must be entered by the end user? Or is there another way? Thank you.

Hello

Here is a link explaining what you can do with collections: http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/advnc.htm#BABFFJJJ

Basically, a Collection is a specific session 'table' which has 50 fields of varchar2 (4000) - once the user session is complete, the collection will automatically be deleted.

To set up:

1 create a tabular presentation on:

SELECT TO_NUMBER(c001) FROM_VALUE,
TO_NUMBER(c002) TO_VALUE
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'YourCollectionName'

2. now, create a collection - in a process before the header of page something like:

IF NOT APEX_COLLECTION.COLLECTION_EXISTS('YourCollectionName') THEN
 APEX_COLLECTION.CREATE_COLLECTION('YourCollectionName');
END;

3 now create your process to loop through the collection when the user clicks on the Send button:

BEGIN
FOR c1 IN (SELECT TO_NUMBER(c001) FROM_VALUE, TO_NUMBER(c002) TO_VALUE FROM APEX_COLLECTIONS WHERE COLLECTION_NAME = 'YourCollectionName')
LOOP
 -- your code that does something for the numbers between c1.FROM_VALUE and c1.TO_VALUE;
END LOOP;
END;

4 - the final code above can also be used to remove from the collection, assuming that everything went ok and you don't need the data again:

APEX_COLLECTION.DELETE_COLLECTION('YourCollectionName');

Andy

Tags: Database

Similar Questions

Maybe you are looking for