Subject Re: [ib-support] Computed fields and nulls
Author Marcus Monaghan
Brian,

> You left out the suspend at the bottom of your procedure:
> MNTH_OPEN_SCORE = PLAYER_OPEN_SCORE + SUM_SCORES;
> SUSPEND; /* <- gotta have it!*/
> END
>

I just couldn't wait to test this out so took some time out and went home.

You are one in a million well spotted. I added SUSPEND to the end of the
procedure and hay presto everything kicked into life.

I sent myself and email with the meta for the table but it hasn't arrived
yet. I will send it tomorrow. However from memory all I did was

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))),
....

Brian, note the use of double "((" and "))" these are required when doing a
SELECT.

This would NOT work (note only one opening and closing "(", ")" ):
"OPENING_SCORE" COMPUTED BY (SELECT TOTAL_MONTH_SCORE FROM
CALC_MONTH_SCORE(PLAYER_MONTHS.PLAYER_CODE,PLAYER_MONTHS.PLAYER_YEAR,PLAYER_
MONTHS.PLAYER_MONTH))

Hope this helps.

Regards,
Marcus.