Skip to Main Content

SQL & PL/SQL

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!

How to get XMLElement to not print anything if value is null?

361137Jul 25 2011 — edited Jul 26 2011
I thought that if the value is null, it wont print anything but it does. Is there a way to configure this behavior?

example if I have these two rows in the table

ColumnA
+++++++
A
<NULL>

select XMLElement("Test", ColumnA) ...other tags..... from TableA
-------------
<Test>A</Test>....other tags.....
<Test></Test>....other tags.....

I would prefer that the second one never shows up instead of an open tag close tag and nothing in between
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2011
Added on Jul 25 2011
2 comments
2,369 views