i try to split the values of an page item in Oracle Apex 5.1. What I did first was to concat the values like this for an autocomplete. The users need to know the department of the employees. The result is saved in the page item PX_Employee.
select name || ',' || department from table;
Result: John Cooper, Department1
In order to get the E-Mail of John Cooper I need to split the values from each other. To get the email I use this code (works fine without concat)
DECLARE
mail VARCHAR(40);
BEGIN
select email
into mail
FROM table
WHERE NAME = :PX_Employee;
:PX_MAIL := mail;
EXCEPTION
WHEN NO_DATA_FOUND THEN
mail := NULL;
END;