How to use Dynamic SQL in reports in OTM?
Hello team,
The below one is giving error while compiling and what would be the value of P_NAME_PARAM finally submits to the query. please suggest.
CREATE OR REPLACE PACKAGE PKG_SAMPLE_REPORT
IS P_NAME VARCHAR2(32766) := '1=1';
P_NAME_PARAM VARCHAR2(32766) := ‘1=1’;
FUNCTION AFTER_PFORM
RETURN BOOLEAN
IS P_NAME_PARAM := s.shipment_name || REPORTS_LIBRARY.GET_FILTER_CONDITION(PNAME, NULL, ‘Y’);
END AFTER_PFORM;
END PKG_SAMPLE_REPORT;
The data template would use the lexical to formulate a where clause:
<parameters>
<parameter name=”P_NAME” dataType=”character” defaultValue=”1=1”/>
</parameters>
<dataQuery>
<sqlStatement name="Q_1">
<![CDATA[SELECT s.shipment_gid, s.shipment_name