SQL Server and varchar field NOT NULLABLE

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lucascompa
Posts: 7
Joined: Mon 09 Jun 2008 07:49

SQL Server and varchar field NOT NULLABLE

Post by lucascompa » Tue 02 Sep 2008 13:09

Hi.

I'm using D2007 and the latest Unidac available. 1.0.8.

I have a SQL 2005 table with a field "test" varchar(150) part of the primary key. (so it is not nullable).

I want to set the value '' in this field (not null!).

If I connect a TUniTable object to that table, and try with the data editor (or via code, it's the same) to "clear" the actual field content setting a '' value, it raise an exception saying it cannot write a null value to the "test" field.

In DB Monitor I see:

UPDATE testtable SET test=? where [..]

Params:
test IN WideString[0] NULL

I've tried to workaround the problem with the generic/specific parameters of the connection or the unitable, but nothing can change this wrong behavior.

How can I solve this issue?

Thanks

Luca Scomparin

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 04 Sep 2008 10:38

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Post Reply