closing cursor in dbms_xmlgen.getXML

DECLARE
l_clob   CLOB;
ctx      DBMS_XMLGEN.CTXHANDLE;
BEGIN
ctx   := DBMS_XMLGEN.NEWCONTEXT (‘select 1 id,cursor(select 1 subid from dual) subid from dual’); –Assign the query as a new context
DBMS_XMLGEN.GETXML ( ctx, l_clob);
–do your processing on l_clob
DBMS_XMLGEN.CLOSECONTEXT (ctx);  –close the context to release all open cursors or any other resources.
END;

Regards

Mohammad Talat

Advertisements