Hello,
Playing around with attached databases in sqlite 3.6.17, I notice that it
is possible to create triggers that operate across attached databases, but
not views. So something along the lines of:
attach database "other.db" as other;
create table other.a(a integer);
create table b(a integer);
create view v as select * from a union select * from b;
will fail with an error "no such table: main.a" and if explicitly linked
to "other" then it fails with the error "cannot reference objects in
database other".
However, the following will work:
create trigger t before insert on b
when (select rowid from a where a=new.a) is null
begin
select raise(abort,'need to insert into a first!');
end;
Is there a technical reason why triggers work, but views don't, or is this
just a feature that's not currently supported in views? I know that I can
create a temporary view and this works. Is this something I can "hack"
easily and has anyone any experience? I'm not afraid of getting my
fingers dirty!
Thanks
Will
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users