Re: UPDATE TRIGGER on view WAS: Re: [SQL] Relation in tables

2005-02-16 Thread PFC
And all this time I thought that you couldn't write to a view. You can't. But you can make it seem so you can. You can create an ON UPDATE/INSERT trigger on a view which intercepts the UPDATE/INSERT to the view (which would otherwise fail) and do whatever you want with it, includi

Re: UPDATE TRIGGER on view WAS: Re: [SQL] Relation in tables

2005-02-16 Thread Tom Lane
PFC <[EMAIL PROTECTED]> writes: > You can create an ON UPDATE/INSERT trigger on a view which intercepts the > UPDATE/INSERT to the view (which would otherwise fail) and do whatever you > want with it, including doing the operation on the real table. This might work for INSERT but I really doub

UPDATE TRIGGER on view WAS: Re: [SQL] Relation in tables

2005-02-16 Thread Keith Worthington
On Wed, 16 Feb 2005 19:56:25 +0100, PFC wrote > [snip] Use UPDATE triggers on the > views, which in fact write to the products table [snip] You can DO that!?! Are you saying that a client can DELETE or INSERT or UPDATE a view and through a trigger you can make this happen? Way cool. Can you p