Conditional Lists of Values in Oracle APEX?

Sonny Boy picture Sonny Boy · Oct 8, 2009 · Viewed 9.7k times · Source

I need to use the value of one Select List to populate the value of a second select list, but the items in Select List number two are going to be from a completely different tables depending on what's selected in list number one.

Is there a way I can conditionally populate the second list based on the values from the first? So far, my attempts to put an if statement into an LOV declaration have been unsuccessful...

Answer

Tony Andrews picture Tony Andrews · Oct 8, 2009

The syntax to use an IF in an Apex LOV is like this:

IF :P123_CHOICE = 'EMP' THEN
  RETURN
  'SELECT ename d, empno r
   FROM emp';
ELSE
  RETURN
  'SELECT dname d, deptno r
   FROM dept';
END IF;