Advertisement
xJupiter

Untitled

May 27th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. CREATE OR REPLACE procedure export_ucs IS
  2.  
  3. v_sqlselect VARCHAR2(4000);
  4. v_queryctx DBMS_XMLQuery.ctxType;
  5. v_clob_par CLOB;
  6.  
  7. BEGIN
  8.  
  9. v_sqlselect := 'select * from gtd10.xucs where rownum <= 100';
  10. v_queryctx := DBMS_XMLQuery.newContext(v_sqlselect);
  11.  
  12. DBMS_XMLQuery.setEncodingTag(v_queryctx, 'ISO-8859-1');
  13. DBMS_XMLQuery.setRowSetTag(v_queryctx,UPPER('CURSOS'));
  14. DBMS_XMLQuery.setRowTag(v_queryctx, UPPER('UC'));
  15.  
  16. v_clob_par := DBMS_XMLQuery.getXML(v_queryctx);
  17. DBMS_XMLQuery.closeContext(v_queryctx);
  18.  
  19. DBMS_OUTPUT.PUT_LINE(v_clob_par);
  20.  
  21. END;
  22.  
  23. execute export_ucs;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement