xml - Loop through groups of records in Oracle SQL procedure -
i have stored procedure generates row of xml info derived entire contents of table in oracle sql:
procedure table_to_xml( table_in in varchar2, xml_table in varchar2, row_id in integer, encoding in varchar2, header_tag in varchar2, rows_tag in varchar2, row_tag in varchar2, xmlheading in varchar2, xmlfullheading in varchar2 ) ctx dbms_xmlquery.ctxhandle; xml clob; begin ctx := dbms_xmlquery.newcontext('select * '||table_in); dbms_xmlquery.setencodingtag(ctx , encoding); dbms_xmlquery.setdataheader(ctx, 'deletethisblankline', header_tag); dbms_xmlquery.setrowsettag(ctx, rows_tag); dbms_xmlquery.setrowtag(ctx, row_tag); dbms_xmlquery.setrowidattrname(ctx,null); dbms_xmlquery.usenullattributeindicator(ctx,false); xml := dbms_xmlquery.getxml(ctx); xml := replace(xml,'deletethisblankline'||chr(10),''); xml := replace(xml,'<'||xmlheading||'>','<'||xmlfullheading||'>'); execute immediate 'insert '||xml_table||' values(:x,:y)' using row_id, sys.xmltype.createxml(xml); commit; dbms_xmlquery.closecontext(ctx); end table_to_xml; the source table of info enormous, end xml file big fails import intended destination. there straight forwards way can split results particular number of rows, , each grouping of records generate total xml file (including headers , footers specificed), without changing how procedure called?
most functions in oracle seem have ability natively split things up, haven't found xml functions.
xml oracle stored-procedures
No comments:
Post a Comment