• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1125
  • Last Modified:

Select XMLElement() gives XML parsing failed error


I'm looking at using some XML reports, e.g. to return the rows in XML.

I've found references to XMLElement() which should enclose the data in tags, but I always get the error "ORA-31011: XML parsing failed".

E.g. one simple example I've seen on the web is using sysdate, but this doesn't work for me:

SQL> SELECT XMLELEMENT("date", sysdate) FROM dual;
ORA-31011: XML parsing failed

Am I doing something wrong? Using Oracle 10g in a 9.2 SQL*Plus window.

Thanks in advance,

1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
it works fine for me (Oracle

I found a metalink note that suggests to apply at least server patch

Bug 2560740  XML Parser throws incorrect error on UTF8 database
 This note gives a brief overview of bug 2560740.

    Product (Component)    Oracle XML Developers Kit (XML Developer's Kit for C)
    Range of versions believed to be affected    Versions < 10G
    Versions confirmed as being affected    


    Platforms affected    Generic (all / most platforms affected)


    This issue is fixed in    

        * (Server Patch Set)
        * XDK Patch
        * 10G Production Base Release


    * Error may occur
    * ORA-31011

Related To:

    * XDK


    XML Parser throws incorrect error on UTF8 database

The full bug text (if published) can be seen at Bug 2560740
This link will not work for UNPUBLISHED bugs.
leonstAuthor Commented:
Thanks for your post.

I've asked around and it looks like there's a setup problem here...

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now