Subject Not working: COMPUTED field based on another table's COMPUTED field via a SP
Author Raymond Kennington
The COPMUTED values in Table2 appear correctly,
but the COMPUTED values in Table1 are all zero.

Why?

The structure and logic are:

Table1
ID1 BIGINT
T COMPUTED BY ((SELECT T from get_T1(Table1.ID1)))

get_T1 (TheID1 BIGINT)
RETURNS (T NUMERIC(18,3)
BEGIN
SELECT SUM(Table2.T)
FOR "Table2.ID1" = :TheID1
INTO T
END

Table2
ID2 BIGINT
ID1 BIGINT
T COMPUTED BY ((SELECT T FROM get_T1(Table2.ID2)))

get_T2 (TheID2 BIGINT)
RETURNS (T NUMERIC(18,3)
BEGIN
SELECT SUM(Table3.Value)
FOR "Table3.ID2" = :TheID2
INTO T
END

Table3
ID3 BIGINT
ID2 BIGINT
Value NUMERIC(9,3)



--
Raymond Kennington
Programming Solutions
TeamW2W (InfoPower)