Subject RE: [firebird-support] adding one year to date
Author Alan McDonald
> CREATE PROCEDURE IS_LEAPYEAR (
> D TIMESTAMP
> ) RETURNS (
> LY INTEGER
> ) AS
> BEGIN
> IF ( 2 = EXTRACT(MONTH FROM (D - EXTRACT(YEARDAY FROM D) + 59)) ) THEN
> LY = 1; /* leap year */
> ELSE
> LY = 0; /* normal year */
> END
>
>
> but when I try:
> SELECT * FROM IS_LEAPYEAR('27.04.2003');
>
> returned is 'null'.
>
> any ideas?

You need to SUSPEND after assigning your return values.
Alan