Subject Re: [firebird-support] FB or D3 Compatibility with FreeUDFLib.dll
Author Helen Borrie
At 09:25 AM 24/06/2003 -0700, you wrote:
>I am trying to migrate from the original release of OS IB 6.01 to FB,
>preferably D3.
>(I've just downloaded and installed 1.03)
>The following trigger causes the server to hard stop:
>Declare Variable PDD Integer;
> If ((new.duedate is not null)) then
> begin
> PDD = F_AGEINDAYS(new.duedate, 'now');
> If (PDD < -32768) then
> PDD = -32768;
> If (PDD > 32767) then
> PDD = 32767;
> new.PastDueDays = PDD;
> end
> else
> new.PastDueDays = 0;
>Seems if I replace 'now' with Current_Date or Current_TimeStamp all is well.
>Current_Date is not supported in dialect 1 but Current_TimeStamp appears to
>be which is understandable due to the non-existant DATE reference in D1.
>Is the above a bug (the incompatibility with 'now') or do I need to go
>through the database looking for instances like these and change them to

Yes, or to CAST('now' as timestamp) if you want the timestamp to be NOW,
rather than the time when the trigger started.

You'll need to cast ALL date literals in D3, otherwise they'll be taken to
be strings.

If you are using the IB 5.6 version of FreeUDFLib then none of the date
functions will work properly. There is a revised version at