Subject Re: [firebird-support] adding one year to date
Author Martijn Tonies
> > 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.

and you want to make it SELECTable.

There's no need for SUSPEND in executable procedures.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com