我在Oracle application Express 4.2中有一个SQL查询(PL/SQL函数体返回SQL查询).我创建了一个经典报告,这是我在下面使用的查询.我的查询当前工作正常但我需要使用另一个查询更新此函数中的现有查询,当我尝试更改查询时它不起作用.我究竟做错了什么?任何帮助表示赞赏.
以下是我的工作查询:
declare
a_query varchar2(5000);
this_strin varchar2(50);
begin
a_query := 'select flight_nmbr, sequence_nmbr '||
'from flights '||
'where sequence_nmbr >= 0 and data_version_name = ''' ||
:P3_DATA_VERSION || '''';
if :P3_SEARCH_NUMBER is not null then
if instr(:P3_SEARCH_NUMBER, '%') > 0 then
this_strin := :P3_SEARCH_NUMBER;
else
this_strin := '%'||:P3_SEARCH_NUMBER||'%';
end if;
a_query := a_query||chr(10)||
' and flight_nmbr like '''|| upper(this_strin) ||'''';
end if;
return a_query;
end;
Run Code Online (Sandbox Code Playgroud)
我需要将此函数内的查询更新为以下内容:
SELECT FLIGHT_NMBR, SCHEDULED_LAUNCH_DATE
FROM FLIGHTS
WHERE DATA_VERSION_NAME = 'WORKING' AND
sequence_nmbr …Run Code Online (Sandbox Code Playgroud)