Converting SYS_REFCURSOR to xml [message #665872] |
Wed, 27 September 2017 23:54 |
|
sampathkore4444@gmail.com
Messages: 8 Registered: January 2014
|
Junior Member |
|
|
Hi Guys,
I am facing below issue while converting SYS_REFCURSOR output to an xml.
ERROR CODE=-19202
ERROR MESSAGE=ORA-19202: Error occurred in XML processing
ORA-24374: define not done before fetch or execute and fetch
Please find the code below,
DECLARE
l_refcursor SYS_REFCURSOR;
l_xmltype XMLTYPE;
P_CUST_NO VARCHAR2(100) := '0122304';
BEGIN
TEST_PACKAGE.PR_GET_DETAILS(p_cust_no, l_refcursor);
l_xmltype := XMLTYPE(l_refcursor);
dbms_output.put_line(l_xmltype.getClobVal());
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR CODE=' || SQLCODE);
DBMS_OUTPUT.PUT_LINE('ERROR MESSAGE=' || SQLERRM);
END;
Sometimes the code is working fine and most of the times i am getting above error.
Kindly help.
Regards,
Sampath
[mod-edit: code tags added by bb; next time please add them yourself]
[Updated on: Sat, 30 September 2017 23:22] by Moderator Report message to a moderator
|
|
|
|