Subject Re: [firebird-support] Computed Column
Author Martijn Tonies
Hi Werner,


> Have a table with column quantityonhand which is computed.
>
> COMPUTED BY (quantitypurchased-quantityconsumed)
>
> Now the problem I have is that the column does NOT compute when I
> update one of the two columns (purchased or consumed).

What do you mean with "does not compute"? A COMPUTED BY
expressesion is evaluated on every row retrieval, it ALWAYS computes.

> Both columns are defined as Int and the computed column is BigInt, and
> all have no default.
>
> When I update from a Python program with kinterbasdb the computed
> column is not updated.

Mind you, the result of a COMPUTED BY isn't stored.

Make sure you do a re-select after you've updated columns and that
your transactions is finished, and/or your transaction isolation makes
sense.


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com