Subject | Re: [Firebird-Architect] NOT UPDATABLE fields |
---|---|
Author | Fabricio Araujo |
Post date | 2005-02-25T03:38:04Z |
On Thu, 24 Feb 2005 11:22:07 -0500, Jim Starkey wrote:
if someone try to do UPDATE statements against it, a exception
should be raised.
On the hand, INSERTS and before insert triggers can change
the field content.
>Adriano dos Santos Fernandes wrote:This mean that the field cannot be used in UPDATE statements,
>
>>Many of my tables have fields with the values should not be changed.
>>These tables has on update triggers that update others tables.
>>
>>For integrity of the data (in case of the value is changed), I have to
>>check if old.field <> new.field and raise exception or maintain
>>complicated triggers with update the others tables depending on the old
>>value too.
>>
>>This syntax will be very helpful:
>>
>>create table t
>>(
>> f integer not updatable
>>);
>>
>>I think the flag can be stored in rdb$relation_fields.rdb$update_flag.
>>Check should be done at execution time because flag can be changed with
>>"alter table ... type ...".
>>
>>
>>
>>
>Does this mean that it can't be assigned to, or just that it's value
>can't be changed?
if someone try to do UPDATE statements against it, a exception
should be raised.
On the hand, INSERTS and before insert triggers can change
the field content.