Subject | Re: [IBO] TIB_Column.GetAsVariant inconsistent return value if Null |
---|---|
Author | Jason Wharton |
Post date | 2002-03-13T18:40:39Z |
I'm really not 100% certain what to do about this issue. NULL's have been a
pain in the rump for some time now.
How about all of you talk this over and come to a consensus.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
pain in the rump for some time now.
How about all of you talk this over and come to a consensus.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "mmenaz" <mmenaz@...>
To: <IBObjects@yahoogroups.com>
Sent: Saturday, March 09, 2002 10:35 AM
Subject: [IBO] TIB_Column.GetAsVariant inconsistent return value if Null
> Patching FastReport IBO part, I've discovered something seems a bad
behaviour of IBO, since the code behaves differently from the
> couterpart VCL (and also differs from logic!)
>
> If I've a field that is NULL (SQL null, I mean), reading it AsVariant
returns a Unassigned variant instead of a varNull.
> Unassigned means that the variant WAS NOT ASSIGNED, while varNull means
that contains the ASSIGNED null value.
>
> Here the code:
> IBAColumn.IMP
> function TIB_Column.GetAsVariant: Variant;
> begin
> Result := Unassigned;
> if not IsNull then
> case SQLType of
> ...
> end;
>
> should become
> begin
> Result := Unassigned;
> if not IsNull then
> begin
> case SQLType of
> ...
> end;
> end
> else
> Result := varNull;
>
> I've tried tha patch, but there are a lot of problems, since I think that
IBO in many places relies upon this strange return value (i.e. maste detail
relation stops working, if I recall correctly).
> So only Jason can make this work properly...
> Thanks
> Marco Menardi