Need help please DBMS_XMLQUERY

Hello ,
i am trying to generate a xml in a db orcle 9i release Release 9.0.1.4.0 so i don not have many of the new functionality
the code i am trying to execute is the foolowing
DECLARE
p_entityid LONG;
p_entitylegalname VARCHAR2(100);
p_businesstradenameone VARCHAR2(100);
p_businesstradenametwo VARCHAR2(100);
p_businesstradenamethree VARCHAR2(100);
p_dunsnumber NUMBER;
queryctx DBMS_XMLQUERY.ctxtype;
RESULT CLOB;
BEGIN
queryctx :=
SYS.DBMS_XMLQUERY.newcontext
('select :p_EntityID EntityID, :p_EntityLegalName EntityLegalName ,
cursor( select :p_BankAccountID BankAccountID ,
:p_BankCode BankCode
from dual ana) AS dt
from dual ana');
SYS.DBMS_XMLQUERY.setrowsettag(queryctx, 'CreateEntityRequest');
SYS.DBMS_XMLQUERY.setrowtag(queryctx, 'Entity');
SYS.DBMS_XMLQUERY.setbindvalue(queryctx, 'p_EntityID', 1);
SYS.DBMS_XMLQUERY.setbindvalue(queryctx, 'p_EntityLegalName', ' prueba');
SYS.DBMS_XMLQUERY.setbindvalue(queryctx, 'p_BankAccountID', 23);
SYS.DBMS_XMLQUERY.setbindvalue(queryctx, 'p_BankCode', '123');
RESULT := SYS.DBMS_XMLQUERY.getxml(queryctx);
printclobout(RESULT);
SYS.DBMS_XMLQUERY.closecontext(queryctx);
END;
these give me the following xml
| <?xml version = '1.0'?>
| <CreateEntityRequest>
| <Entity num="1">
| <ENTITYID>1</ENTITYID>
| <ENTITYLEGALNAME> prueba</ENTITYLEGALNAME>
| <DT>
| <DT_ROW num="1">
| <BANKACCOUNTID>23</BANKACCOUNTID>
| <BANKCODE>123</BANKCODE>
| </DT_ROW>
| </DT>
| </Entity>
| </CreateEntityRequest>
the problem that i have is it writes this tag <DT_ROW num="1"> that i do not want an also it puts in the tag <Entity num="1"> the num="1"
does sono one know how remove it
i am desperate many thanks
ana

Hello
I've read about the same problem on different places and everyone provides an alternative instead of the real solution.
After reading soms specs on the Oracle website, I found this simple solution:
dbms_xmlquery.setrowidattrname(query_ctx, NULL); -- default num
dbms_xmlquery.setrowidattrvalue(query_ctx, NULL);
Simply clear the default attribute (which is a constant of xmlquery) and it's value and you are set.
Kind Regards
Bjorn Ongenae
iAdvise Consulting

Similar Messages

Maybe you are looking for

  • Reading one line from a text file into an array

    i want to read one line from a text file into an array, and then the next line into a different array. both arays are type string...i have this: public static void readAndProcessData(FileInputStream stream){      InputStreamReader iStrReader = new In

  • How to load data from a string to diff Column

    Hi, In a table i am getting data like as a string '101,SAM,2000,20,SALES' '102,RAM,3000,30,MARKETING' i want to load this data into different column in Target table so i have to cut out this data and have to load into different target Column.

  • Male to female voice changer app?

    hi everybody! anyone know whats the name of this app, where you can change your voice from male to female or vise versa in real time while making a call?  thanks!

  • How to Call Same Adaptive RFC across different Backend R/3 Systems

    Hi Everyone, I have been troubled for the last 3 or 4 days on how I should develop Web DynPro code to call the same RFC on different backend R/3 systems.  Don't really want to maintain my own Jco connects within a SAP Connector project and I don't re

  • Different footage resolution editing on FCP

    Hi If I am making a wedding video using footage from these 2 different sources Sony V1E capturing in 1080i or 1080p giving me 1440x1080 resolution, vid rate 25 compressor Apple intermediate codec Either Gopro HD Hero capturing in 4:3 tallest HD Video