Subject Re: Foreign Key implementation
Author Adam
--- In firebird-support@yahoogroups.com, Aage Johansen <aagjohan@...>
wrote:
>
> Adam wrote:
> > ...
> >
> > Then you must find this not sensible:
> >
> > Tr1:
> > insert into employee_project (emp_no, proj_id) values (4, 'GUIDE');
> > [don't commit]
> >
> > Tr2:
> > update employee set salary = salary+100 where emp_no=4;
> >
> > Firebird is perfectly happy to do it in this order, but surely the
> > same logic should disallow this?
> >
>
> I would think that the update works fine, but it isn't updating any
> record (Rowsaffected=0) since it cannot see the record with EMP_NO=4.

I am not sure what you mean. Emp_No=4 is "Bruce Young" in the employee
database that shipped with the version of Firebird on my laptop. This
record exists and is visible to both Tr1 and Tr2. Perhaps you are
confusing which table the Tr1 insert is using.

Adam