Subject | Re: [IBO] Posting nulls into NOT NULL fields. |
---|---|
Author | Helen Borrie |
Post date | 2001-10-15T01:31:34Z |
At 04:35 PM 14-10-01 +0200, you wrote:
To post a null, you have to do one of two things:
a) exclude the field in question from your update SQL statement. IOW, if you are using the standard Insert() method on a dataset that selects your non-nullable field, Delphi will post a zero-equivalent
b) explicitly make the field's value null by calling Clear, e.g.
FieldByName('MyField').Clear;
regards,
Helen
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Hello,I believe that you will discover that no nulls have been posted. In TDataset, all "empty" fields are made to be zero-equivalent - zero in numerics and dates, empty string (#0) in character fields.
>
>With the versions > 4.2 Ee I have the following problem:
>
>With TIBOQuery I can post null values into fields defined in InterBase as
>NOT NULL.
To post a null, you have to do one of two things:
a) exclude the field in question from your update SQL statement. IOW, if you are using the standard Insert() method on a dataset that selects your non-nullable field, Delphi will post a zero-equivalent
b) explicitly make the field's value null by calling Clear, e.g.
FieldByName('MyField').Clear;
>With TIB_Query I solved this problem with ColumnAttributesThe BLANKISNULL attribute forces (b) above on the field it applies to.
>MyField=BLANKISNULL.
>How it is possible that InterBase not null fields accept null values ?It isn't possible. If you wish to post nulls, you must do a) or b) above and also set CheckRequired false on that field.
regards,
Helen
>Thanks for helpAll for Open and Open for All
>
>Peter Czarnecki
>Eustachio SA
>
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________