SQL Server provider and Null string

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
burdian
Posts: 29
Joined: Wed 19 Nov 2008 19:25

SQL Server provider and Null string

Post by burdian » Sat 29 Nov 2008 16:27

Hi,

Delphi 2007, UniDAC 1.20.0.13.

When I edit string field via, for example, DBEdit control and delete value, SQL Server post to database '' not null value.

Oracle and Interbase providers post correct null value!

TIA and Best regards
Branko

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 01 Dec 2008 08:44

When you assign an empty string to a field, this empty string is posted to the database. When you assign Null to a field, Null is posted to the database. This is the correct behaviour.

There was a bug in the InterBase provider. We'll fix this bug in the next UniDAC build. So that the InterBase provider will also post an empty string.

Oracle server does not distinguish NULL and empty string. When you insert an empty string to the Oracle database it is always replaced with NULL.

burdian
Posts: 29
Joined: Wed 19 Nov 2008 19:25

Post by burdian » Mon 01 Dec 2008 10:03

Then there is no possibility to assign null value thru DB Controls?
Perhaps Option.EmptyStringToNull?

Best regards
Branko

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 02 Dec 2008 08:06

UniDAC does not have such feature.

burdian
Posts: 29
Joined: Wed 19 Nov 2008 19:25

Post by burdian » Tue 02 Dec 2008 10:05

Yes, I know, this is just my suggestion.

Best regards
Branko

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 03 Dec 2008 08:28

We are planning to add such option in one of the next UniDAC builds.

Post Reply