I want to pass items in PLSQL dynamic content region to be used for where clause. Is this not possible or I just did it wrong?
I tried to set variable with item value and add it to where clause but it seems not working.
I also tried to print the item value to check if it is passing through plsql dynamic content but its not.
THIS IS MY SAMPLE CODE:
declare
v_year number := :P1_year;
cursor c_tasks is
select task_name, assigned_to
from eba_ut_chart_tasks
where year >= :P1_year;
begin
sys.htp.p('<table>');
sys.htp.p('<tr>');
for a in c_tasks loop
sys.htp.p('<td>' || a.task_name || ' (' || a.assigned_to || ')</td>' );
end loop;
sys.htp.p('</tr>');
sys.htp.p('</table>');
sys.htp.p(v_year);
end;
After pressing search Button to refresh the region, table still doesn`t filter. I also tried putting the value in variable just to see if its passing through the PLSQL content but still not working.
This is a sample table contents:
In Apex, I created a region whose type is "Dynamic content". It contains a select list item for years and submits the page when a new value is chosen:
As Apex requires, its (region's) source is a function (body that returns a CLOB) so - let it return something (
NULLwill do). Also,<tr>tags should be include into the loop, otherwise you'll get everything in only one row.When executed: