1
votes

I have a form with a select list, where the user can select anywhere from 1 to 50 options, basically, my PL/SQL code first creates an "event", that is only one item, however then, I want to create associations of that event with "services" of which there can be several selected. So I need something akin to a loop to do this.

One other issue is that when I select multiple items in a select list or checkbox, the value that comes in is something like "1:5:3:4:8", so I if there is a better way than writing a function to split, add all them to an array and then loop on the array and add each one of these id's individually. I feel like I have the wrong approach.

1

1 Answers

1
votes

You won't need to write a function, because APEX supplies one: apex_util.string_to_table:

declare
    tab apex_application_global.vc_arr2;
begin
    tab := apex_util.string_to_table (:p1_multiple_item);
    ...
end;

You can specify the delimiter as a second parameter, but since the default is ':' you don't need to.