Preserve blanks in CHAR columns

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Daniel Stucki
Posts: 1
Joined: Mon 18 Aug 2008 10:57

Preserve blanks in CHAR columns

Post by Daniel Stucki » Mon 18 Aug 2008 11:32

In our tables, we have columns defined as CHAR(1). These columns can contain alpha numeric values, blanks included.
With OraDirect 4.70.38.0 all the blanks are trimmed. That is, after executing a SELECT with one of these CHAR-columns which contain only one blank, we'll get back an empty string and not a string with one blank.

In an older post (back in 2004), you mentioned "... a special option to OracleCommand...". Unfortunately, I'm not able to find this magic thing...

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 20 Aug 2008 14:18

This feature is not available in the current versions of OraDirect .NET.
It is recommended to process such returning results on your side by the code.

alicee
Posts: 3
Joined: Wed 24 Mar 2010 12:07

Post by alicee » Wed 11 Aug 2010 15:04

Are there any plans to implement this feature?
Your recommendation to essentially handle it ourselves leaves a lot to be desired :/

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 12 Aug 2010 15:05

We will investigate this issue again and notify you about results as soon as possible.

alicee
Posts: 3
Joined: Wed 24 Mar 2010 12:07

Post by alicee » Tue 17 Aug 2010 13:14

Thanks for looking into this.

Other providers such as DataDirect and Oracle's ODP.net handle this situation correctly, so it would be awesome if Devart could too.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 18 Oct 2010 09:37

We have added the Trim Fixed Char connection string parameter (and the OracleConnection.TrimFixedChar property). This option specifies whether blank value from CHAR(size) is trimmed by dotConnect for Oracle or not. It affects all command objects of this connection. Behaviour of data reader depends on the Trim Fixed Char value at the moment of opening data reader. The default value is true.

I will post here when the corresponding build is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 04 Nov 2010 14:33

New build of dotConnect for Oracle 5.70.190 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=19420 .

Post Reply