Subject | RE: [firebird-support] Computed column madness |
---|---|
Author | Bill Meaney |
Post date | 2006-02-08T19:44:30Z |
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
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