<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Trick #4 &#8211; Pull XML with DBMS_XMLGEN</title>
	<atom:link href="http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/</link>
	<description>Steve Karam's Oracle Blog</description>
	<lastBuildDate>Tue, 24 Jan 2012 01:33:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Arijit Mukherjee</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44501</link>
		<dc:creator>Arijit Mukherjee</dc:creator>
		<pubDate>Fri, 23 Dec 2011 07:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44501</guid>
		<description>Hi Steve,

     I am trying to run the following script...


DECLARE 
    qryCtx dbms_xmlgen.ctxHandle;
    result CLOB;
BEGIN
    qryCtx :=  dbms_xmlgen.newContext (&#039;SELECT * from Employee WHERE Emp_id = 221930 ;&#039;);
    dbms_xmlgen.setRowSetTag(qryCtx, &#039;Employee_Details&#039;);
    dbms_xmlgen.setRowTag(qryCtx, &#039;Employee&#039;); 
    
    result := dbms_xmlgen.getXML(qryCtx) ;
    dbms_xmlgen.closeContext(qryCtx);
    INSERT INTO temp_xml VALUES(result);
END ;


     But getting the following error:

ORA-19202: Error occurred in XML processing
ORA-00911: invalid character
ORA-06512: at &quot;SYS.DBMS_XMLGEN&quot;, line 7
ORA-06512: at &quot;SYS.DBMS_XMLGEN&quot;, line 147
ORA-06512: at line 12
19202. 00000 -  &quot;Error occurred in XML processing%s&quot;
*Cause:    An error occurred when processing the XML function
*Action:   Check the given error message and fix the appropriate problem


       I am not able to understand what the exact problem is. Could you please help me out on this?

Best regards,
Arijit</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>     I am trying to run the following script&#8230;</p>
<p>DECLARE<br />
    qryCtx dbms_xmlgen.ctxHandle;<br />
    result CLOB;<br />
BEGIN<br />
    qryCtx :=  dbms_xmlgen.newContext (&#8216;SELECT * from Employee WHERE Emp_id = 221930 ;&#8217;);<br />
    dbms_xmlgen.setRowSetTag(qryCtx, &#8216;Employee_Details&#8217;);<br />
    dbms_xmlgen.setRowTag(qryCtx, &#8216;Employee&#8217;); </p>
<p>    result := dbms_xmlgen.getXML(qryCtx) ;<br />
    dbms_xmlgen.closeContext(qryCtx);<br />
    INSERT INTO temp_xml VALUES(result);<br />
END ;</p>
<p>     But getting the following error:</p>
<p>ORA-19202: Error occurred in XML processing<br />
ORA-00911: invalid character<br />
ORA-06512: at &#8220;SYS.DBMS_XMLGEN&#8221;, line 7<br />
ORA-06512: at &#8220;SYS.DBMS_XMLGEN&#8221;, line 147<br />
ORA-06512: at line 12<br />
19202. 00000 &#8211;  &#8220;Error occurred in XML processing%s&#8221;<br />
*Cause:    An error occurred when processing the XML function<br />
*Action:   Check the given error message and fix the appropriate problem</p>
<p>       I am not able to understand what the exact problem is. Could you please help me out on this?</p>
<p>Best regards,<br />
Arijit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Mueller</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44426</link>
		<dc:creator>George Mueller</dc:creator>
		<pubDate>Wed, 19 Jan 2011 07:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44426</guid>
		<description>Dear  The Oracle Alchemist ,

I need to generate a main query that will give record by record instruction and then i need to generate a second query where all the summation history of the main records will be displayed....

for example: 


    
        1
       MBB ASSET BOOK
       10309
       AA TANAMAN HIJAU ENTERPRISE
       FIXED ASSET
       800161134
       OFFICE EQUIPMENT.OE0011
       CAPITALIZED
       86111
      AC-MBB ACCOUNTING
      2
      1
      
      1000.00
      1000.00
      1000.00
      MYR
      
      2010/06/29
      1198
      2010/07/01
      1002
     
     
        0
        3506
        3
        2011/01/17
       EGL
       -1
         1
    -1
     


In the above example the first ROW tag is from the main query.  The last ROW tag is from the second query that is the summation of the Main query.

How to keep the tags same as ROW query for both first and second query and how to nest this two queries in single execution to get this kind of xml format.  all the tag specified are very important like ROOT and ROW.......

Thanks in Advance.</description>
		<content:encoded><![CDATA[<p>Dear  The Oracle Alchemist ,</p>
<p>I need to generate a main query that will give record by record instruction and then i need to generate a second query where all the summation history of the main records will be displayed&#8230;.</p>
<p>for example: </p>
<p>        1<br />
       MBB ASSET BOOK<br />
       10309<br />
       AA TANAMAN HIJAU ENTERPRISE<br />
       FIXED ASSET<br />
       800161134<br />
       OFFICE EQUIPMENT.OE0011<br />
       CAPITALIZED<br />
       86111<br />
      AC-MBB ACCOUNTING<br />
      2<br />
      1</p>
<p>      1000.00<br />
      1000.00<br />
      1000.00<br />
      MYR</p>
<p>      2010/06/29<br />
      1198<br />
      2010/07/01<br />
      1002</p>
<p>        0<br />
        3506<br />
        3<br />
        2011/01/17<br />
       EGL<br />
       -1<br />
         1<br />
    -1</p>
<p>In the above example the first ROW tag is from the main query.  The last ROW tag is from the second query that is the summation of the Main query.</p>
<p>How to keep the tags same as ROW query for both first and second query and how to nest this two queries in single execution to get this kind of xml format.  all the tag specified are very important like ROOT and ROW&#8230;&#8230;.</p>
<p>Thanks in Advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44250</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 21 Aug 2009 17:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44250</guid>
		<description>Is there a max output filesize limit to XML Publisher that you have come across? I don&#039;t see anything in the Oracle XML Publisher documentation. Thanks</description>
		<content:encoded><![CDATA[<p>Is there a max output filesize limit to XML Publisher that you have come across? I don&#8217;t see anything in the Oracle XML Publisher documentation. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron Kincer</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44122</link>
		<dc:creator>Ron Kincer</dc:creator>
		<pubDate>Fri, 12 Jun 2009 22:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44122</guid>
		<description>I am encountering a problem in that I use rpad(field.name,4, &#039; &#039;) in my query and when the sql encounters the first &#039; it thinks it is at the end of the script and wants a right parenth.  My sql hasa the &#039; in numerous places and I cannot seem to get around this.  any suggestions?

Thanks
Ron</description>
		<content:encoded><![CDATA[<p>I am encountering a problem in that I use rpad(field.name,4, &#8216; &#8216;) in my query and when the sql encounters the first &#8216; it thinks it is at the end of the script and wants a right parenth.  My sql hasa the &#8216; in numerous places and I cannot seem to get around this.  any suggestions?</p>
<p>Thanks<br />
Ron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44074</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Fri, 08 May 2009 23:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44074</guid>
		<description>I want to know if RSS feeds can be directly taken into an oracle table.  How would I import an RSS feed since it is XML?  Would I have to put the RSS feed into a file first or could it be realtime?</description>
		<content:encoded><![CDATA[<p>I want to know if RSS feeds can be directly taken into an oracle table.  How would I import an RSS feed since it is XML?  Would I have to put the RSS feed into a file first or could it be realtime?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toni</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44067</link>
		<dc:creator>Toni</dc:creator>
		<pubDate>Thu, 26 Mar 2009 20:30:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44067</guid>
		<description>I thought this explanation was awesome. Straigtforward how to - what a concept!
I am new to xml publisher and just plain old xml. I&#039;m trying to run the following but there additional quotes makes it cough - suggestions? 
set pages 0
set linesize 150
set long 999999999
set head off
select dbms_xmlgen.getxmltype(&quot;select distinct a.business_unit, a.account, a.operating_unit, a.monetary_amount, a.journal_date, c.category_descr 
from  owner.ps_jrnl_ln a, owner.ps_sch_energy_acct b, owner.ps_sch_energy_catg c, owner.ps_jrnl_header d
where a.business_unit = b.setid
and   a.account = &#039;50102&#039;
and   a.account = b.account
and   a.operating_unit in(&#039;117&#039;,&#039;118&#039;,&#039;133&#039;,&#039;136&#039;,&#039;173&#039;,&#039;191&#039;,&#039;703&#039;,&#039;706&#039;,&#039;721&#039;,&#039;754&#039;)
and   b.CATEGORY_TYPE = c.CATEGORY_TYPE&quot;) xml from dual;</description>
		<content:encoded><![CDATA[<p>I thought this explanation was awesome. Straigtforward how to &#8211; what a concept!<br />
I am new to xml publisher and just plain old xml. I&#8217;m trying to run the following but there additional quotes makes it cough &#8211; suggestions?<br />
set pages 0<br />
set linesize 150<br />
set long 999999999<br />
set head off<br />
select dbms_xmlgen.getxmltype(&#8220;select distinct a.business_unit, a.account, a.operating_unit, a.monetary_amount, a.journal_date, c.category_descr<br />
from  owner.ps_jrnl_ln a, owner.ps_sch_energy_acct b, owner.ps_sch_energy_catg c, owner.ps_jrnl_header d<br />
where a.business_unit = b.setid<br />
and   a.account = &#8217;50102&#8242;<br />
and   a.account = b.account<br />
and   a.operating_unit in(&#8217;117&#8242;,&#8217;118&#8242;,&#8217;133&#8242;,&#8217;136&#8242;,&#8217;173&#8242;,&#8217;191&#8242;,&#8217;703&#8242;,&#8217;706&#8242;,&#8217;721&#8242;,&#8217;754&#8242;)<br />
and   b.CATEGORY_TYPE = c.CATEGORY_TYPE&#8221;) xml from dual;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neeraj</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44065</link>
		<dc:creator>Neeraj</dc:creator>
		<pubDate>Thu, 19 Mar 2009 15:08:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44065</guid>
		<description>Hi,

I ran the following  as an sql file :

set serveroutput 
set long 2000000000                                                             
set pagesize 0 
set pages 0                                                                 
set linesize 150                                                                
set buffer 6000000
set echo off                                                                    
set heading off                                                                 
set underline off                                                               
set trimspool off                                                               
spool C:\Neeraj\SQLPLUS\Exported_Data\ACE_DATA.xml                              
select dbms_xmlgen.getXML(&#039;select * from SK101468_190.ACE_DATA&#039;) from dual;                                                                       
spool off                                                                       
set echo on                                                                     
set heading on                                                                  
set underline on                                                                
set trimspool on                                                                

It produces xml that can be opened using IE..only if I run it using PL/SQL developer..when I run it using SQL*Plus..it produces xml..but IE throws an error when opening this xml..at somepoint...showing the ending tag is wrapped down..so invalid tag</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I ran the following  as an sql file :</p>
<p>set serveroutput<br />
set long 2000000000<br />
set pagesize 0<br />
set pages 0<br />
set linesize 150<br />
set buffer 6000000<br />
set echo off<br />
set heading off<br />
set underline off<br />
set trimspool off<br />
spool C:\Neeraj\SQLPLUS\Exported_Data\ACE_DATA.xml<br />
select dbms_xmlgen.getXML(&#8216;select * from SK101468_190.ACE_DATA&#8217;) from dual;<br />
spool off<br />
set echo on<br />
set heading on<br />
set underline on<br />
set trimspool on                                                                </p>
<p>It produces xml that can be opened using IE..only if I run it using PL/SQL developer..when I run it using SQL*Plus..it produces xml..but IE throws an error when opening this xml..at somepoint&#8230;showing the ending tag is wrapped down..so invalid tag</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gopi</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44064</link>
		<dc:creator>Gopi</dc:creator>
		<pubDate>Wed, 18 Mar 2009 03:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44064</guid>
		<description>can we convert Dtd to xml</description>
		<content:encoded><![CDATA[<p>can we convert Dtd to xml</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanu</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-44056</link>
		<dc:creator>Tanu</dc:creator>
		<pubDate>Wed, 11 Feb 2009 22:17:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-44056</guid>
		<description>Hey,

Can you please explain the procedures of the package in detail.

Thanks.!</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>Can you please explain the procedures of the package in detail.</p>
<p>Thanks.!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ravikumar</title>
		<link>http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/comment-page-1/#comment-43972</link>
		<dc:creator>ravikumar</dc:creator>
		<pubDate>Thu, 18 Sep 2008 18:35:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.oraclealchemist.com/news/trick-4-pull-xml-with-dbms_xmlgen/#comment-43972</guid>
		<description>Good Post.. I have been trying in vain to remove the &#039;_ROW&#039; tag that is displayed in the sub nodes. I know it differentiates the different rows. But my requirement is such that I need to remove the &#039;_ROW&#039; tag.

Can someone help me find a way ?? It&#039;s urgent for me.</description>
		<content:encoded><![CDATA[<p>Good Post.. I have been trying in vain to remove the &#8216;_ROW&#8217; tag that is displayed in the sub nodes. I know it differentiates the different rows. But my requirement is such that I need to remove the &#8216;_ROW&#8217; tag.</p>
<p>Can someone help me find a way ?? It&#8217;s urgent for me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

