[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] running queries on attached database tables
From:       Richard Hipp <drh () sqlite ! org>
Date:       2016-09-30 15:00:51
Message-ID: CALwJ=MzK5Cjf4j-E0FwMT4mKOz4kVxPg=2aJy34j3LMWK2FEJQ () mail ! gmail ! com
[Download RAW message or body]

On 9/30/16, Simon Slavin <slavins@bigfraud.org> wrote:
>
> On 30 Sep 2016, at 2:13pm, Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr>
> wrote:
>
>> My application is normally working on DatabaseA. I run an attach command
>> for
>> DatabaseB like:
>> Attach DatabaseB as source
>>
>> After a successful attach. If I want to select something from
>> DatabaseB-Table3 is it enough to call below SQL?
>> Select * from Table3
>>
>> Or, even if there is no table names that overlap on each other, Do I still
>> need to run something as follows:
>> Select * from source.Table3
>
> Use the second one: "source.Table3".  It may be possible that the first one
> works but it is not documented and may stop working in later versions of
> SQLite.

The second one will always work.  The problem is, what if the schema
for the first database changes and a new Table3 is added there.  You
may want to do "source.Table3" just to future-proof your application.

-- 
D. Richard Hipp
drh@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic