Subject | Re: [firebird-support] adding one year to date |
---|---|
Author | Martijn Tonies |
Post date | 2004-04-28T12:39:37Z |
> > CREATE PROCEDURE IS_LEAPYEAR (and you want to make it SELECTable.
> > 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.
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