Subject RE: [ib-support] Computed fields and nulls
Author Brian K. Woods
> -----Original Message-----
> From: Brian K. Woods [mailto:brian@...]
> Sent: Wednesday, January 15, 2003 11:50 AM
> To: ib-support@yahoogroups.com
> Subject: RE: [ib-support] Computed fields and nulls
>
>
> > By the way, contrary to other other advice, you don't use SUSPEND in a
> > procedure that returns only a one-row set. SUSPEND doesn't do anything,
> > other than perform an EXIT, under any conditions except when you are
> > processing a cursor (i.e. operating a FOR SELECT loop). You can (and
> > probably should) invoke it with EXECUTE and read the output parameters.
> >
> > It would help if you would say what environment you are testing it in.
> >
> > heLen
>
[snip]
> As Marcus asked, is this a bug, feature or both? And if not, is there a
> difference
> in the stored proc syntax that makes it need/not need the SUSPEND?

Helen,
Actually, after re-reading the related posts, I think we are both right,
just miscommunicating.
I think I see the cause of confusion.

Marcus is using the proc with a select statement in a computed by field:
CREATE TABLE "PLAYER_MONTHS"
(
"PLAYER_CODE" VARCHAR(10) NOT NULL,
"PLAYER_YEAR" INTEGER,
"PLAYER_MONTH" INTEGER,
"OPENING_SCORE" COMPUTED BY ((SELECT TOTAL_MONTH_SCORE FROM
CALC_MONTH_SCORE(PLAYER_MONTHS.PLAYER_CODE,PLAYER_MONTHS.PLAYER_YEAR,PLAYER_
MONTHS.PLAYER_MONTH))),
....

I tested, and apparently, a single result set procedure (like this one)
without SUSPEND, works
using EXECUTE, as you suggested, but not with select * from proc_name.
This suggests several things:
1.A single row proc will be compatible with either method if you put the
suspend (flexibility), but
2.shouldn't firebird be fixed so that it works with either method without
the suspend as well? (thus
eliminating the confusion)
3.Also, is there a way to use an EXECUTED proc in a COMPUTED BY clause, or
must you use the select method?

Anyway,
Thanks again for your dedication to these lists. You're a gem!
Brian