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!

XMLTYPE getClobVal() empty XML elements

kikolusOct 6 2019 — edited Oct 7 2019

After upgrade my DB from version 11.2.0.4 up to 18 I observe that from now XMLType.getClobVal() returns an empty XML elements for null valued attributes of types. For example type:

create or replace type kl_test force as object(id number,str varchar2(10));

when I execute following code snippet:

begin

dbms_output.put_line( XmlType(cabasys.kl_test(1,null)).getClobVal());

end;

then instead of

<KL_TEST><ID>1</ID></KL_TEST>

I got

<KL_TEST>

<ID>1</ID>

<STR/>

</KL_TEST>

I found that this was treated as a bug and fixed within version 12.

Is is any possibility to back to previous behavior and do not send empty elements?  It unnecessary utilizes memory and space when processing large object with nullable attributes.

Comments
Post Details
Added on Oct 6 2019
4 comments
2,157 views