[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #3021: gb.db2 Null dates error


http://gambaswiki.org/bugtracker/edit?object=BUG.3021&from=L21haW4-

Comment #1 by bruce B:

I'll try to clarify this a bit.

On the database the value of, say the "datechanged" column is null as the record has not been changed, only added.

1. On the loading of the record, the result column, "this!datechanged" is a null. If I try to put that into a Gambas Date variable, say Person.DateOfNameChange As Date it gets cross and complains. So I set the date variable to a date that I can tell actually means "not changed yet" as the date is before any possible real value. That is fine and I can code around it, i.e If Person.DateOfNameChange < Person.Birthdate then ... ignore the value.

2. On their birthday I want to update Person.Age+=1 and save that back to the database. And maybe some other Person.<data> has changed as well.

3. So I want to copy all the current Person data back into an update-able Result and do a Result.Save. Now when I look at the Person.DateOfNameChange I can tell that it is my pseudo-null value and set Result!datechanged to Null.

This is where the issue lies. Although I set it to Null the gb.db2 component sets it to some value that is patently not a Null. That is saved to the database and causes me bulk pain the next time I read that record.

gb.db did not do that. It properly set the value to a real Null! 

So AFAIC this is a real BUG in gb.db2 

b


----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----

References:
[Gambas-bugtracker] Bug #3021: gb.db2 Null dates error<bugtracker@xxxxxxxxxxxxxx>