Subject | Error function in FB 2.1 |
---|---|
Author | mike_guzman84 |
Post date | 2009-04-30T20:44:19Z |
HI I HAD A ERROR IN A DB RECENTLY MIGRATED OF FB 1.5 TO FB 2.1, IN A DLL I HAD THIS FUNCTION WHO CALL THE TYPE RECORD.
TISC_QUAD = record
gds_quad_high : Longint;
gds_quad_low : Cardinal;
end;
PISC_QUAD = ^TISC_QUAD;
function MinuteToHour(var M : Integer) : PISC_QUAD;
var TempDate : TCTimeStructure; Hr, Mt, S, MS : Word;
begin
Result := malloc(SizeOf(TISC_QUAD));
FillChar(TempDate, SizeOf(TCTimeStructure), 0);
DecodeTime(IncMinute(0, M), Hr, Mt, S, MS);
with TempDate do
begin
tm_sec := S;
tm_min := Mt;
tm_hour := Hr;
end;
isc_encode_date(@TempDate, Result);
end;
BUT WHEN I TRY TO DO A SELECT FOR EXAMPLE
SELECT D.*, MinuteToHour(TAB_HOUR) as HOUR_START
FROM DB_TABLE D, DB_TABLE_2 E
WHERE D.TAB_ID = E.TBL_TABLEID
WHEN I RUN THIS CONSULT BRING A MESSAGE SAY
'Unsuccessful execution caused by the system error precludes
successful execution of subsequent statements
Error writting data to the connection'.
the FIELD TAB_HOUR is type integer and never is null, in FB 1.5 run without problems. why in FB 2.1 break... what sentence of my code is wrong i dont know.. thx for you time.
TISC_QUAD = record
gds_quad_high : Longint;
gds_quad_low : Cardinal;
end;
PISC_QUAD = ^TISC_QUAD;
function MinuteToHour(var M : Integer) : PISC_QUAD;
var TempDate : TCTimeStructure; Hr, Mt, S, MS : Word;
begin
Result := malloc(SizeOf(TISC_QUAD));
FillChar(TempDate, SizeOf(TCTimeStructure), 0);
DecodeTime(IncMinute(0, M), Hr, Mt, S, MS);
with TempDate do
begin
tm_sec := S;
tm_min := Mt;
tm_hour := Hr;
end;
isc_encode_date(@TempDate, Result);
end;
BUT WHEN I TRY TO DO A SELECT FOR EXAMPLE
SELECT D.*, MinuteToHour(TAB_HOUR) as HOUR_START
FROM DB_TABLE D, DB_TABLE_2 E
WHERE D.TAB_ID = E.TBL_TABLEID
WHEN I RUN THIS CONSULT BRING A MESSAGE SAY
'Unsuccessful execution caused by the system error precludes
successful execution of subsequent statements
Error writting data to the connection'.
the FIELD TAB_HOUR is type integer and never is null, in FB 1.5 run without problems. why in FB 2.1 break... what sentence of my code is wrong i dont know.. thx for you time.