Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Function body returning SQL query does not compile

AppExApr 12 2024 — edited Apr 12 2024

It gives an error on line 4 “v_where :=…”

ORA-20999: Parsing returned query results in "ORA-20999: Failed to parse SQL query! ORA-06550: line 4, column 4: ORA-00936: missing expression".

Not sure what is wrong with this block that returns a SQL statement for the Classic Report region's query? P120_COLUMNS is a Checkbox Group.

declare
v_table varchar2(30) := :P120_TABLE;
v_cols varchar2(100) := replace(:P120_COLUMNS, ':', ',');
v_where varchar2(100) := '';
begin
if :P120_WHERE is not null then
v_where := ' where ' || :P120_WHERE;
end if;
return 'select ' || v_cols || ' from ' || v_table || v_where;
end;

Using apex.oracle.com

This post has been answered by AppEx on Apr 12 2024
Jump to Answer
Comments
Post Details
Added on Apr 12 2024
5 comments
1,186 views