[odb-users] A view on top of several tables from different sqlite files (DB)

Boris Kolpackov boris at codesynthesis.com
Mon Sep 7 12:00:54 EDT 2015


Hi Yoav,

Weiss, Yoav <yoav.weiss at intel.com> writes:

> So I did: m_p_db->connection()->execute ("ATTACH DATABASE cell.sqlite
> AS cells") Which worked fine, but the first query (using 
> m_p_db->query_one()) on a table inside cells DB, I got: 1: no such
> table: hier_version
> 
> I think this is caused by me using the connection pointer, but I'm
> not sure.

It would only be a problem if your application needed several
connections at the same time. If you executed the two statements
one after another, the query_one() would reuse the connection
that was created for the first.

Try to qualify the table name with the database name as I suggested
in my previous reply. I am suspecting this ability to use unqualified
table names with multiple databases is a recent addition to SQLite.

Boris



More information about the odb-users mailing list