We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Select XMLElement() gives XML parsing failed error

leonst asked
Medium Priority
Last Modified: 2012-06-21

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,

Watch Question

Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Thanks for your post.

I've asked around and it looks like there's a setup problem here...
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.