Hi I'm making an anonymous block to test extract function on my XML.
This is I,m using
DECLARE
i_xpayload CLOB;
l_result_success VARCHAR2(50);
BEGIN
DBMS_OUTPUT.PUT_LINE ('hi');
i_xpayload := XMLTYPE('<Confirmation revision="001">
<App>
<Sender>
<Component>A</Component>
<Confirm>Never</Confirm>
</Sender>
<CreationDateTime>2017-06-13</CreationDateTime>
</App>
</Confirmation>').getclobval();
l_result_success := i_xpayload.EXTRACT ('/Confirmation/App/Sender/Confirm//text()').getstringval ();
DBMS_OUTPUT.PUT_LINE ('l_result_success ' || l_result_success);
END;
The procedure is completed successfully when I'm not using
l_result_success := i_xpayload.EXTRACT ('/Confirmation/App/Sender/Confirm//text()').getstringval ();
DBMS_OUTPUT.PUT_LINE ('l_result_success ' || l_result_success);
But when I do it is giving me error
ORA-06550: line 19, column 36:
PLS-00487: Invalid reference to variable 'I_XPAYLOAD'
ORA-06550: line 19, column 5:
PL/SQL: Statement ignored
Can someone tell me please what I'am doing wrong.
TIA