Subject Re: [ib-support] Firebird RC1
Author Rob Schuff
i don't think this is a problem really. just do a fake join. I have 1
table that exists solely for this purpose. It has no data, just fields of
the type I use for primary keys (currently 2) All of my views are created
using an left outer join on this table and it works fine

As far as "fixing" the problem, I think the best solution would be to add an
option to the create view statement maybe like [updateable] so that all
views by default are not updateable and are only updatable through
definition of triggers. I guess if the engine would not update views
automatically the [updateable] option would not be necessary after all.

FWIW

Rob

---------------------------------------------------------------------
Robert Schuff Bull Run Software
rob@... Portland, OR USA
---------------------------------------------------------------------
----- Original Message -----
From: "Martijn Tonies" <martijn@...>
To: <ib-support@yahoogroups.com>
Sent: Monday, November 26, 2001 2:37 AM
Subject: RE: [ib-support] Firebird RC1


> Hi,
>
> > create table t(a int not null primary key, b int);
> > create view v as select a,b from t;
> > set term ^;
> > create trigger tr for v before insert as
> > begin insert into t values(new.a, new.b); end^
> > set term ;^
> >
> > If "a" is the PK of T, you'll get a duplicate value
> > exception: the default
> > action took place, then the trigger tried to insert, too.
> > Since both are
> > using the value of "a" unmodified, they clash on the PK's index:
> >
> > SQL> insert into v values(0);
> > Statement failed, SQLCODE = -803
> > violation of PRIMARY or UNIQUE KEY constraint "INTEG_2" on table "T"
> >
> > There's no solution, you should do a fake join to force your
>
> Will this problem get fixed in FB?
>
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>