Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
Thanks everyone for your helpfinally got it working. very simple answer and trivial but took me hours to look for this online and I still dont see this answer online but here it is for anyone who may be a newbie like myself sqlite3 db1 "attach ARGS1_DB as db1; select * from args"

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread P Kishor
Perhaps you should start by telling *all* your sqlite issues. That would make for more efficient help being provided. See more below -- On Sun, Mar 14, 2010 at 8:21 PM, David Lyon wrote: > I tried getting ATTACH to work since this am (EST) and have been looking in > the

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
I tried getting ATTACH to work since this am (EST) and have been looking in the different sqlite forums but have yet to find a simple and clear description of how to get this to work. I have the ARGS1_DB and contains args table. when I attach the ARGS1_DB to db1, I dont get the args table from

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 06:22:15PM -0700, David Lyon scratched on the wall: > Can you or someone provide the exact syntax for ATTACH http://www.lmgtfy.com/?q=sqlite+attach+command=1 ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 05:01:18PM -0700, David Lyon scratched on the wall: > if I had a database called db1 with table tbl1 with field id and a > second db called db2 and a table called tbl2 with field id, whats the > correct syntax to query across the 2 databases eg: > > "select * db1..tbl1 a ,

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
thanks for your reply Can you or someone provide the exact syntax for ATTACH and then the subsequent SQL syntax so I get the equivalent to: "select * db1..tbl1 a , db2..tbl2 b where a.id=b.id" Thanks again! --- On Sun, 3/14/10, P Kishor wrote: > From: P Kishor

Re: [sqlite] VACUUM & journal size

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 07:19:59PM -0400, Matthew L. Creech scratched on the wall: > Hi, > > I have a SQLite database with one large table, and I'd like to shrink > the size of that table to free up space in the filesystem. My problem > is that the database is (for example) 100 MB, and I have

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread P Kishor
On Sun, Mar 14, 2010 at 6:01 PM, David Lyon wrote: > if I had a database called db1 with table tbl1 with field id and a second db > called db2 and a table called tbl2 with field id, whats the correct syntax to > query across the 2 databases eg: > > "select * db1..tbl1 a ,

[sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
if I had a database called db1 with table tbl1 with field id and a second db called db2 and a table called tbl2 with field id, whats the correct syntax to query across the 2 databases eg: "select * db1..tbl1 a , db2..tbl2 b where a.id=b.id" This doesnt work, can someone modify it to work?

Re: [sqlite] Error in documentation for FOREIGN KEY ?

2010-03-14 Thread Simon Slavin
On 14 Mar 2010, at 11:13pm, Kees Nuyt wrote: > Well, it is consistent, when you take > http://www.sqlite.org/syntaxdiagrams.html#table-constraint > into account. > > CREATE TABLE is the only statement where references > constraints can be defined. Have a look at >

[sqlite] VACUUM & journal size

2010-03-14 Thread Matthew L. Creech
Hi, I have a SQLite database with one large table, and I'd like to shrink the size of that table to free up space in the filesystem. My problem is that the database is (for example) 100 MB, and I have 80 MB of free filesystem space. I figured that I could DELETE, say, half of the records from

Re: [sqlite] Can I add a FOREIGN KEY later ?

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 10:05:14PM +, Simon Slavin scratched on the wall: > I was trying to work out if I could add a FOREIGN KEY to a table > after it is originally created, using the ALTER TABLE command. > Assuming that my database was originally created with 3.6.19 or > later, can I do

Re: [sqlite] Error in documentation for FOREIGN KEY ?

2010-03-14 Thread Kees Nuyt
On Sun, 14 Mar 2010 22:04:18 +, Simon Slavin wrote: > I was trying to work out if I could add a FOREIGN KEY to a table after > it is originally created, using the ALTER TABLE command. I think there's an > error on > >http://www.sqlite.org/syntaxdiagrams.html > > I

Re: [sqlite] Error in documentation for FOREIGN KEY ?

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 10:04:18PM +, Simon Slavin scratched on the wall: > http://www.sqlite.org/syntaxdiagrams.html > > I cannot find anything on that page that includes the actual > words 'FOREIGN KEY'. http://www.sqlite.org/syntaxdiagrams.html#table-constraint For a column

Re: [sqlite] Can I add a FOREIGN KEY later ?

2010-03-14 Thread Kees Nuyt
On Sun, 14 Mar 2010 22:05:14 +, Simon Slavin wrote: > I was trying to work out if I could add a FOREIGN KEY to a table after > it is originally created, using the ALTER TABLE command. > Assuming that my database was originally created with 3.6.19 > or later, can I do

[sqlite] Can I add a FOREIGN KEY later ?

2010-03-14 Thread Simon Slavin
I was trying to work out if I could add a FOREIGN KEY to a table after it is originally created, using the ALTER TABLE command. Assuming that my database was originally created with 3.6.19 or later, can I do this ? Simon. ___ sqlite-users mailing

[sqlite] Error in documentation for FOREIGN KEY ?

2010-03-14 Thread Simon Slavin
I was trying to work out if I could add a FOREIGN KEY to a table after it is originally created, using the ALTER TABLE command. I think there's an error on http://www.sqlite.org/syntaxdiagrams.html I cannot find anything on that page that includes the actual words 'FOREIGN KEY'. The section

Re: [sqlite] Fastest concurrent read-only performance (+ threads vsprocesses) [BUG?]

2010-03-14 Thread Luke Evans
Absolutely. For what I'm trying to do, and given my experiments thus far, I would love to replicate the performance of the one-query/thread-per-process concurrency in the multithreaded case, foregoing the resource optimisations (shared cache etc.) and just having each query/thread do

Re: [sqlite] structure question

2010-03-14 Thread Max Vlasov
nci...@aquarelo.com> wrote: > Thanks Dannis, > > The problem is a little bigger. I must have 2 instances of same table: > original and latest. Then my problem is what is the best way to: > - transform 'original' with same data as 'latest'. This is 'save'. > - transform 'latest' with same data

Re: [sqlite] structure question

2010-03-14 Thread Francisco Azevedo
Thanks Dannis, The problem is a little bigger. I must have 2 instances of same table: original and latest. Then my problem is what is the best way to: - transform 'original' with same data as 'latest'. This is 'save'. - transform 'latest' with same data as 'original'. This is 'undo'. I must

[sqlite] FTS3 (Version 2 .6.23) - Is the boolean operator "AND" no more available?

2010-03-14 Thread gerard.jouannot
Hello all SQLlite users. I wonder if the operator "AND" (in capitals letters) is yet available and different from the basic term "and" (in lower letters). Using the "MatchInfo" example of the documentation, I build an FTS3 virtual table like this: -- Create and populate an FTS3 table with four

Re: [sqlite] Can default column values use max() ?

2010-03-14 Thread Simon Slavin
On 14 Mar 2010, at 3:14pm, P Kishor wrote: > CREATE TABLE books ( > id INTEGER PRIMARY KEY, > title TEXT, > author INTEGER DEFAULT (SELECT Max(id) FROM authors) > ); > > and that just ain't gonna work. Thanks, Puneet, I think that's the syntax I was groping towards. Good to know it wasn't

Re: [sqlite] Can default column values use max() ?

2010-03-14 Thread P Kishor
On Sun, Mar 14, 2010 at 8:26 AM, Simon Slavin wrote: > My real database is too ridiculous to explain here, so here is an analogy: > > Table 1: Authors        -- columns id (INTEGER PRIMARY KEY), name (TEXT) > Table 2: Books          -- columns id (INTEGER PRIMARY KEY),

[sqlite] Can default column values use max() ?

2010-03-14 Thread Simon Slavin
My real database is too ridiculous to explain here, so here is an analogy: Table 1: Authors-- columns id (INTEGER PRIMARY KEY), name (TEXT) Table 2: Books -- columns id (INTEGER PRIMARY KEY), author (INTEGER), title (TEXT) When I enter a new book, I want the author to default

Re: [sqlite] Fastest concurrent read-only performance (+ threads vsprocesses) [BUG?]

2010-03-14 Thread Olaf Schmidt
"Marcus Grimm" schrieb im Newsbeitrag news:4b9a01e8.2060...@medcom-online.de... > Increasing the number of threads does affect the overall > read performance slightly, example: > 1 Thread: 11.2 sec > 16 Threads: 8.2 sec > Single Process: 11sec. > > I still would expect