Select XMLElement() gives XML parsing failed error

Posted on 2006-04-18
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,

Question by:leonst
    LVL 142

    Accepted Solution

    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.
    LVL 1

    Author Comment

    Thanks for your post.

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
    Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
    This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
    Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now