October 10, 2013
So you are using Oracle APEX shuttle in your form and will give the ability to user to select multiple value from the list. The next challenge is to store the selected values into the Oracle database.
Please check below code:
Where should I put those code?
1.Page Processing > Processing > Process, right click > Create
2.Select PL/SQL and you may procees the rest
3.When you see 'Enter PL/SQL Page Process', paste the code here. Please change accordingly follow your item page name and table/column in your database.
Oracle APEX Shuttle : How to do it?
In this post, I will talk about storing the multiple values into Oracle database in a way of storing the value one by one. Meaning that, if there are 4 active selection, the operation will be storing or insert the 4 value into Oracle table each row. So there will be 4 insert operation will be executed.Please check below code:
declarePlease note that :PX_YOUR_ITEM is referring to your Shuttle Item name.
tab apex_application_global.vc_arr2;
begin
tab := apex_util.string_to_table (:PX_YOUR_ITEM);
for i in 1..tab.count loop
insert into YOUR_TABLE (YOUR_COLUMN_NAME, YOUR_SHUTTLE_COLUMN_NAME)
values
('My List', tab(i) );
end loop;
end;
Where should I put those code?
1.Page Processing > Processing > Process, right click > Create
2.Select PL/SQL and you may procees the rest
3.When you see 'Enter PL/SQL Page Process', paste the code here. Please change accordingly follow your item page name and table/column in your database.
yahaya!
ReplyDeletethank yu so much sir, could you pls help me out with the select list in the same way
ReplyDeleteIf I have understood correctly if I select 5 values will it insert 5 rows in the table
ReplyDeleteYou are correct.
Deletenice post!! thanks for share
ReplyDelete