1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

ORACLE Tutorials

Print any XML from SQL in Oracle

CREATE OR REPLACE PROCEDURE print_xml (p_sql IN VARCHAR2)
IS
v_clob CLOB;
l_xml VARCHAR2 (30000);
l_line VARCHAR2 (2000);
l_amt PLS_INTEGER := 30000;
l_idx PLS_INTEGER := 1;
BEGIN
SELECT DBMS_XMLGEN.getxml (p_sql)
INTO v_clob
FROM DUAL;

FOR i IN 1 .. CEIL (DBMS_LOB.getlength (p_xml) / l_amt)
LOOP
l_xml := DBMS_LOB.SUBSTR (p_xml, l_amt, l_idx);

LOOP
EXIT WHEN l_xml IS NULL;
l_line := SUBSTR (l_xml, 1, INSTR (l_xml, CHR (10)) - 1);
DBMS_OUTPUT.put_line ('|' || l_line);
l_xml := SUBSTR (l_xml, INSTR (l_xml, CHR (10)) + 1);
END LOOP;
END LOOP;
END print_xml;

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy