Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLFOREST with EVALNAME problem

user12025285Sep 21 2016 — edited Sep 22 2016

It seems that usinfg nested XMLFOREST with EVALNAME creates wrong xml TAG.

In the example below, the second query won't create the "test" TAG:

create table test_evalname(c1 number,c2 number);

SELECT

XMLElement(

    "TABLE",

    XMLForest(

        e.TABLE_NAME AS "TABLE_NAME",

        e.COLUMN_NAME AS "COLUMN_NAME",

        XMLForest(

            e.DATA_TYPE as "DATA_TYPE",

            e.DATA_LENGTH as "DATA_LENGTH"           

        ) as "test",

        e.NULLABLE AS "NULLABLE"

    )             

) as xxml

from user_tab_columns e

where table_name='TEST_EVALNAME';

SELECT

XMLElement(

    "TABLE",

    XMLForest(

        e.TABLE_NAME AS "TABLE_NAME",

        e.COLUMN_NAME AS "COLUMN_NAME",

        XMLForest(

            e.DATA_TYPE as "DATA_TYPE",

            e.DATA_LENGTH as "DATA_LENGTH"           

        ) as "test",

        e.NULLABLE AS evalname('NULLABLE')

    )             

) as xxml

from user_tab_columns e

where table_name='TEST_EVALNAME';

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2016
Added on Sep 21 2016
3 comments
1,033 views