Subject ERROR UNSUCCESSFUL EXEPTION CAUSED BUT A SYSTEM ERROR FB 2.1.2
Author mike_guzman84
THIS SENTENCE WORKS!!

SELECT FIRST 1 MINUTETOHOUR( T.TAB_MINUTES ) AS HOURS
FROM TAB_ID T

BUT IF I DO A PLAN NATURAL SELECT, THE SENTENCE BREAK

SELECT MINUTETOHOUR( T.TAB_MINUTES ) AS HOURS
FROM TAB_ID T

'UNSUCCESSFUL EXEPTION CAUSED BUT A SYSTEM ERROR THAT PRECLUDES SUCCESSFUL EXECUTION OF SUBSEQUENT STATEMENTS. ERROR WRITING DATA TO THE CONNECTION.'

THE UDF WHERE I USE THE FUNCTION MINUTETOHOUR() WAS CREATED IN DELPHI 6, THIS THE CODE OF THE FUNCTION.

//THE FUNCTION USE A VARIABLE 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;


PREVIOSLY HELEN BORRIE SAID.. OK THE PROBLEM IS PUT THE ALIAS IN THE PARAMATER OF THE FUNCTION AND WORKS... LATER I UPGRADE THE FB 2.1.1 TO 2.1.2 AND I PRUB THE SELECT AND BREAK.. IF ANY HAD ANY IDEA OF HOW TO SOLVE THIS PROBLEM. THX FOR YOUR TIME.