[fpc-pascal] How to clear the value of a field in a table using parameters?

Sven Barth pascaldragon at googlemail.com
Fri Aug 30 17:17:08 CEST 2013


On 30.08.2013 15:42, silvioprog wrote:
> 2013/8/29 Michael Van Canneyt <michael at freepascal.org
> <mailto:michael at freepascal.org>>
>
>     On Thu, 29 Aug 2013, silvioprog wrote:
>
>
>         Other interesting feature is the property EmptyAsNull:
>
>         http://docwiki.embarcadero.__com/VCL/XE/en/IBCustomDataSet.__TIBStringField.EmptyAsNull
>         <http://docwiki.embarcadero.com/VCL/XE/en/IBCustomDataSet.TIBStringField.EmptyAsNull>
>
>         It tests if field (ftString) is empty (f = ''), if yes, it set
>         the field value to null (f.Clear).
>
>
>     Apparently a IBX specific extension.
>
>     I don't see the value of this. empty and null are different things.
>
>     Michael.
>
>
> Some Delphi components (Zeos, JvDBEdit) have this option.
>
> Assuming this table:
>
> test
>    id integer,
>    name varchar(10) not null unique
>
> You can:
>
> id|name
> 1| <null>
> 2| <null>
>
> But:
>
> 1| <empty>
> 2| <empty> << error, unique key

And again here is an exception of the rule: in SQL Server you can't have 
multiple NULL values in a unique key column *sigh*

Regards,
Sven




More information about the fpc-pascal mailing list