Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alias for Cursor ROWS in DBMS_XMLGEN

slokamMay 21 2008 — edited May 28 2008
Gurus,

I have following sample function to generate XML content

==========================================
create or replace function getxmldata
return clob is
mysql DBMS_XMLGEN.ctxHandle;
begin
mysql := DBMS_XMLGEN.newContext('
select cursor(select item_id as "@Item_Id",has_metal,has_stone from pid_item where item_id in (17)) as "ItemHeader"
from dual
');
dbms_xmlgen.setrowsettag(mysql,'ROOT');
dbms_xmlgen.setrowtag(mysql,null);
return(DBMS_XMLGEN.getXML(mysql));
end;

=======================================

When i call this function as "select getxmldata from dual". I do get following output

=======================================
<?xml version="1.0"?>
<ROOT>
<ItemHeader>
<ItemHeader_ROW Item_Id = "17">
<HAS_METAL>N</HAS_METAL>
<HAS_STONE>N</HAS_STONE>
</ItemHeader_ROW>
</ItemHeader>
</ROOT>
=======================================

I want to have Item as Tag name instead of "ItemHeader_ROW" . Can you please let me know how can get this??

Thanks
srinivas.L
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2008
Added on May 21 2008
7 comments
5,344 views