Skip to Main Content

Query must begin with SELECT or WITH error after upgrade

Ishit SharmaApr 1 2021

recently i upgrade Apex from 5.0 to 19.2 and encountered issue with all of my reports that are being generated by PLSQL function body returning SQL query for Classic Reports.
Extra parameter got added into code i.e. return q' { my code }'; which is returning error that it should start from SELECT or WITH.
Can anyone suggest fix for this or is it Apex bug.
return q'{declare
v_sql_wrapper varchar2 (4000);
BEGIN
v_sql_wrapper := rules_pkg.rules_results(:P1110_RULE_ID,:P1110_WD,:P1110_QQ);
v_sql_wrapper := REPLACE(v_sql_wrapper,'SELECT ws.ID','SELECT rh.NUM, ws_ID');
RETURN v_sql_wrapper;
END;}';

Comments
Post Details
Added on Apr 1 2021
5 comments
33 views