0

I have a SQL script that Im building to make a structure, this is the oracle version Im working with "Oracle Database 10g Release 10.2.0.4.0 - 64bit Production", then this is the script:

XMLELEMENT("cbc:InvoicedQuantity", xmlattributes('PEN' as "/@unitCode"))

this is the line that give me the error. I think xml cant parse this characters "/" or "@", is there any solution for this? please, i need help.

user3095751
  • 1
  • 1
  • 1
  • I just tried this on Oracle 11gR2 and it worked fine. The exact query I tried was: 'select XMLELEMENT("cbc:InvoicedQuantity", xmlattributes('PEN' as "/@unitCode")) from dual;' – user1578653 Dec 12 '13 at 15:51

1 Answers1

0

Try to use something like this, maybe it can help.

select replace(xmlelement("cbc:InvoicedQuantity", xmlattributes('PEN' as "
unitCode")),chr(10),'/@')
from dual;

The idea is to use line-break (or any other useless symbol) to replace it with the symbols needed later.

smnbbrv
  • 23,502
  • 9
  • 78
  • 109