Subject | Re: [firebird-support] Naturally updatable views |
---|---|
Author | Helen Borrie |
Post date | 2009-02-18T22:20:48Z |
At 05:14 AM 19/02/2009, you wrote:
If you're using > Fb 1.5, make sure you read the release notes or language updates as well. The rules for views have been subtly changing from release to release.
./hb
>Hello,Yes. Note *naturally* updatable.
> I'm after some clarification about something I have read in the
>firebird book. It says that views are not naturally updatable if the
>view does not select all of the not null fields in a table. Is that
>strictly true?
>I'm just starting to use views and it seems that if theViews that are not naturally updatable can be made updatable if you have before insert triggers to take care of the non-nullable fields. If you declare a default for a non-nullable field and don't include that field in your insert or update set then it will kick in in time to save you from a constraint error.
>field that is not included in the view is updated by a default value or
>a trigger then the view will still be updatable.
If you're using > Fb 1.5, make sure you read the release notes or language updates as well. The rules for views have been subtly changing from release to release.
>Am I correct on thisPerhaps not very clear what "naturally updatable" means. The book does describe the difference in quite some detail.
>or am I likely to get bitten further down the line?People get bitten further down the line when they rely on guesswork. ;-) Always test both execution and results of anything that's designed to change data.
./hb