Subject RE: [firebird-support] Computed column madness
Author Bill Meaney
Try this


CREATE TABLE INVOICE_ITEMS (
INVOICE_NUM NUMERIC_18_0 NOT NULL,
ITEM_NUM INTEGER_SHORT NOT NULL,
RATE NUMERIC_9_2 NOT NULL,
QUANTITY NUMERIC_9_2 NOT NULL,

ITEM_TOTAL COMPUTED BY (CAST ((RATE*QUANTITY) AS NUMERIC(9,2))),
1 23 3 4 421
^

CONSTRAINT PK_INVOICE_ITEMS PRIMARY KEY (INVOICE_NUM,ITEM_NUM)
);

Bill Meaney