Subject | Re: Naturally updatable views |
---|---|
Author | willhonor |
Post date | 2009-02-18T23:04:22Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
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.
Ok, so as long as I have triggers on the View or table. Or I specify a
default on the field/domain then the view remains updatable?
changing from release to release.
Thanks, I will do so.
From reading the book I understand that views which include joins,
subqueries or special readonly queries (select X from rdb$database
etc) are not naturally updatable. Views that have a simple sql on a
single table or that select from another view that has a simple query
are updatable.
designed to change data.
I had tested it but it wasn't doing what I expected. So I posted
here to ask the question. Not relying on guesswork at all just wanted
to clarify the rules.
Thank you for your help Helen. Your book has proved very helpful,
although it is starting to wear out now. Do you have any plans to
update it when firebird 2.5 / 3 are out?
Regards,
Will.
> Views that are not naturally updatable can be made updatable if youhave 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.
Ok, so as long as I have triggers on the View or table. Or I specify a
default on the field/domain then the view remains updatable?
>language updates as well. The rules for views have been subtly
> If you're using > Fb 1.5, make sure you read the release notes or
changing from release to release.
Thanks, I will do so.
>does describe the difference in quite some detail.
> >Am I correct on this
>
> Perhaps not very clear what "naturally updatable" means. The book
From reading the book I understand that views which include joins,
subqueries or special readonly queries (select X from rdb$database
etc) are not naturally updatable. Views that have a simple sql on a
single table or that select from another view that has a simple query
are updatable.
>;-) Always test both execution and results of anything that's
> >or am I likely to get bitten further down the line?
>
> People get bitten further down the line when they rely on guesswork.
designed to change data.
I had tested it but it wasn't doing what I expected. So I posted
here to ask the question. Not relying on guesswork at all just wanted
to clarify the rules.
Thank you for your help Helen. Your book has proved very helpful,
although it is starting to wear out now. Do you have any plans to
update it when firebird 2.5 / 3 are out?
Regards,
Will.