On Sat, 28 Feb 2009 00:20:48 +0300, Alexey Pechnikov
<pechni...@mobigroup.ru> wrote:

>Hello!
>
>On Friday 27 February 2009 21:50:30 Kees Nuyt wrote:
>> A view or trigger in one database is not allowed to
>> reference tables (or other views) in other databases. The
>> reason is, the schema of the main database (in this case
>> your :memory: database) would be invalid once the main
>> database is opened without the attached database, or after
>> detaching it.
>
> So I can create table to saving view definitions and
> create these as "temp view" to all of attached
> databases 

Yes, you could store the text of the SELECT statements
ready for preparing in a table, with ? placeholders for
the value bindings. Or delegate the cross-database SELECTs
to application code and not use VIEWs at all.

> or disable the check of views. I think the define such
> as SQLITE_DISABLE_VIEW_ON_ATTACHED_DATABASE may be
> useful in code.

You could implement that feature in your own branch/fork
of SQLite, but I think it will never make it to the
mainstream source version, because would be a bad thing
to be able to create inconsistent schemas.
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to