0

Is it possible to reference a LOV in plsql?

I need to get the display value from a static LOV from PLSQL to use as a filter on an interactive report.

I have trawled the documentation and google but there is no reference to being able to reference a LOV via plsql.

Any help gratefully received

Mr R
  • 289
  • 1
  • 6
  • 14

1 Answers1

4

You can access the value of an item that has a LOV - that's usually what you want:

select ename from emp
where deptno = :p1_deptno -- P1_DEPTNO is a page item based on an LOV

For static LOVs you can access the display value like this:

select display_value
from apex_application_lov_entries
where application_id = 123
and list_of_values_name = 'DEPT_LOV'
and return_value = :p1_deptno;

For dynamic LOVs you would have to run the query the LOV is based on. This can be obtained from view apex_application_lovs

Tony Andrews
  • 129,880
  • 21
  • 220
  • 259
  • The problem is that I am attempting to programatically filter an interactive report using apex_util.ir_filter, for this I need to pass in the value that is shown within the table rather than the id. The idea behind this is that I want to just display a subset of the records in the report without changing the sql behind the report and the user can then edit the filter if they wish to. I was hoping it would act like an enum. – Mr R Jul 15 '11 at 13:35