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!

Use XMLELEMENT to generate XML but the result is not expected.

607779Nov 9 2007 — edited Nov 13 2007
Hi,
I am using XML DB. I try to run a simple SQl Statement to generate a XML and see the result.
I did below steps,
1)create table xml_element_test (
some_id number primary key,
some_col_1 varchar2(10),
some_col_2 date,
some_col_3 number(5)
);

2)insert into xml_element_test values( 1, 'one' , '15-jan-1974', 74);
insert into xml_element_test values( 2, 'two' , '28-mar-1891', 18);

3)select XMLElement ("SomeElementName", some_col_1) from xml_element_test;

Then I expected below output,
XMLELEMENT("SOMEELEMENTNAME",SOME_COL_1)
----------------------------------------------------
<SomeElementName>one</SomeElementName>
<SomeElementName>two</SomeElementName>

However, The output is,

XMLELEMENT("SOMEELEMENTNAME",SOME_COL_1)
----------------------------------------------------
XMLTYPE()
XMLTYPE()

I don't know what's a problem and how I can see the XML result. I appriciate if you advise.

Thanks,

Shiva
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2007
Added on Nov 9 2007
7 comments
702 views