1) Put the IDs into an Apex collection in a PL/SQL process:
Assume :P5_USER_ID_LIST = '45,4932,20,19'
declare
array apex_application_global.vc_arr2;
begin
array := apex_util.string_to_table (:P5_USER_ID_LIST, ',');
apex_collection.create_or_truncate_collection ('P5_ID_COLL');
apex_collection.add_members ('P5_ID_COLL', array);
end;
2) Then change your query to:
SELECT * FROM users u WHERE u.user_id IN
(SELECT c001 FROM apex_collections
WHERE collection_name = 'P5_ID_COLL')
As simple as that...
Assume :P5_USER_ID_LIST = '45,4932,20,19'
declare
array apex_application_global.vc_arr2;
begin
array := apex_util.string_to_table (:P5_USER_ID_LIST, ',');
apex_collection.create_or_truncate_collection ('P5_ID_COLL');
apex_collection.add_members ('P5_ID_COLL', array);
end;
2) Then change your query to:
SELECT * FROM users u WHERE u.user_id IN
(SELECT c001 FROM apex_collections
WHERE collection_name = 'P5_ID_COLL')
As simple as that...
nice! thanks!
ReplyDeleteTwo years later, still useful!
ReplyDeleteGreat to see it helped!!!
Deletetnks!
ReplyDelete