Subject | Re: [firebird-support] Multitable view update |
---|---|
Author | Adomas Urbanavicius |
Post date | 2005-10-20T08:44:21Z |
First of all., make sure your view is not naturally updatable : FB by
itself tries to update table by such view (usually such view is " select
... from tableX "). I usually avoid this by adding "dummy" join,
something like select .. from tableX inner join rdb$database on
rdb$database.database = 1, or similar. Then FB is incapable of naturall
update :)
Adomas
ricolebo1 wrote:
itself tries to update table by such view (usually such view is " select
... from tableX "). I usually avoid this by adding "dummy" join,
something like select .. from tableX inner join rdb$database on
rdb$database.database = 1, or similar. Then FB is incapable of naturall
update :)
Adomas
ricolebo1 wrote:
>Hi,
>
>I try to update a multitable view by trigger
>and I obtain a strange result (firebird 1.5)
>
>Here is a example :
>
>create view my_view (
> v_id integer,
> v_name varchar(100),
> v_externalfield integer)
>)
>as
>select t1.id,t1.name,(select t2.externalfield from t2) from t1
>
>trigger
> ...
> if (new.v_externalfield <> old.v_externalfield) then
> update t2 set t2.externalfield =new.v_externalfield;
>
>after the update the third field of t1=externalfield value !!
>
>(by example t1.firstname = externalfield)
>
>In fact I want to add external fields in my table and work
>with the wiew as a table.
>
>Thank you
>Eric Gueguiniat
>
>
>
>
>
>
>
>
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://firebird.sourceforge.net and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
>