Oracle APEX - How to create popup LOV which contained multiple display values?

Jestem_z_Kozanowa picture Jestem_z_Kozanowa · Sep 5, 2012 · Viewed 15.6k times · Source

I am trying to create LOV in Oracle Apex 4.1 which would contain name and surname of employees and would return only his/hers id. The syntax which does not work looks like this :

 select
     FIRST_NAME,LAST_NAME as display_value, 
     USER_ID as return_value 
 from ALL_USERS
 order by 1

This returns error : Wrong number of columns selected in the LOV SQL query. Any help or guidance how to tackle this problem greatly appreciated.

Answer

Vincent Malgrat picture Vincent Malgrat · Sep 5, 2012

You could use :

select
     FIRST_NAME || ', ' || LAST_NAME as display_value, 
     USER_ID as return_value 
 from ALL_USERS
 order by 1