Page 1 of 1

XMLType and extra linefeed character

Posted: Tue 05 Feb 2008 14:55
by MarkF
Hi Folks!

I notice that ODAC always returns XMLType fields with an extra linefeed character at the end. Is there any way that this could be fixed? Currently I have to check the datatype and trim the extra character each time. It's not a huge deal, but it would be nice not to have to strip the character all the time.

-Mark Ford
Benthic Software

Posted: Wed 06 Feb 2008 09:01
by Plash
There is a bug in Oracle 9 client. It performs some normalization of XML value. It adds a linefeed character at the and. Moreover, if a XMLTYPE field contains a value like '', this value is returned as ''#10.

To avoid the problem, select XMLTYPE values as CLOBs, using GETCLOBVAL function of XMLTYPE:

Code: Select all

SELECT t.f_xml.getclobval() FROM t_xml t
You also can upgrage the Oracle client to 10.2 version.

Posted: Wed 06 Feb 2008 13:27
by MarkF
I still seem to see the extra linefeed on my version 10 clients. The exact version is 10.2.0.1.0 and my server version is 10.2. As mentioned, this isn't a big deal as I'm working around it. Thanks for your suggestions!

-Mark