Subject Re: [firebird-support] seems bug : Field accepts NULL Values (empty string) even if it is defined with not null constraints ??
Author Daniel Rail
Hi,

At March 16, 2004, 07:06, Jonathan Neve wrote:

> The main thing is that it leads to much confusion, and that I can't
> think of any situation where this subtle distinction would be useful. In
> fact, if you look at TField.AsString (in Delphi), it returns '' if the
> field is null. That's because Delphi doesn't have this subtle
> distinction (of course). In practice, why make this distinction?

The same can be said of TField.AsInteger. It will return zero if the
field is NULL. Those methods are designed to return a valid value for
the type that is asked. And you would get NULL if you do
TField.AsVariant, because in Delphi NULL is of type variant. And, I
can find other such examples for other datatypes in Delphi, where a
NULL value can be misrepresented if using the specific assign
methods(i.e.: TField.AsDateTime = '30/12/1899', if the field value is
NULL).

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)