I am using zeoslib 6.6.3 with Firebird 2.1. I try to convert my app from IBX to ZeosLib.
My table like this:
Code: Select all
CREATE TABLE APP_MODULES
(
ID INTEGER NOT NULL,
VERSION INTEGER NOT NULL,
LASTUPDATED TIMESTAMP DEFAULT 'Now' NOT NULL,
PRIMARY KEY (MODULEID)
);
CREATE TRIGGER APP_MODULES_LASTUPDATED FOR APP_MODULES
ACTIVE BEFORE UPDATE POSITION 0
AS BEGIN
NEW.LASTUPDATED = "Now";
END
Select * from APP_MODULES where ID = :ID
In my ZUpdateSQL, the insertSQL like this:
Code: Select all
Insert into APP_MODULES (VERSION) values (:VERSION)
So I trace the problem and find out under ZDbcCacge.pas:
Code: Select all
function TZRowAccessor.GetTimestamp(ColumnIndex: Integer;
var IsNull: Boolean): TDateTime;
begin
{$IFNDEF DISABLE_CHECKING}
CheckColumnConvertion(ColumnIndex, stTimestamp);
{$ENDIF}
Result := 0;
if FBuffer.Columns[FColumnOffsets[ColumnIndex - 1]] = 0 then
begin
case FColumnTypes[ColumnIndex - 1] of
stDate, stTime, stTimestamp:
Result := PDateTime(@FBuffer.Columns[FColumnOffsets[ColumnIndex - 1] + 1])^;
stString, stUnicodeString:
Result := AnsiSQLDateToDateTime(GetString(ColumnIndex, IsNull));
end;
IsNull := False;
end else
IsNull := True;
end;
Cheers,
Tao