[sqlite] Query problem

2008-01-23 Thread Yasir Nisar
Hi, Hope you will find this mail in the best of your health. SELECT * FROM BackupTable,BackupItemTable,BackItUpPathTable WHERE lower(BackItUpPathTable.WinName) GLOB lower("*1[]1.txt*") AND BackupItemTable.BKItemSize > -1 AND BackupTable.BackupNo = BackupItemTable.BackupNo AND

Re: [sqlite] Multiple databases

2008-01-23 Thread drh
"Mina R Waheeb" <[EMAIL PROTECTED]> wrote: > Hi, >I have few questions regarding the limitation of multiple databases with > SQLite. > > I have a large number of SQLite DB files with the same structure i > need to query them all (looking for speed), I have tried ATTACH method > and its

Re: [sqlite] Query problem

2008-01-23 Thread Jay Sprenkle
You need single quotes for text literals. On Jan 23, 2008 6:15 AM, Yasir Nisar <[EMAIL PROTECTED]> wrote: > SELECT * FROM BackupTable,BackupItemTable,BackItUpPathTable WHERE > lower(BackItUpPathTable.WinName) GLOB lower("*1[]1.txt*") AND > BackupItemTable.BKItemSize > -1 AND

Re: [sqlite] Strange error "Incomplete SQL"

2008-01-23 Thread Vito De Tullio
Ciao, a tutti! il giorno lunedì 21 gennaio 2008 parlavamo "Re: [sqlite] Strange error "Incomplete SQL"" > Do you really need to use version 2.8.17? it's just the default version present in opensuse, I'm just a noob of sqlite (it's the first time I used it) and I'm just "playing" with the cli

Re: [sqlite] .import NULL

2008-01-23 Thread Dennis Cote
Robert Wishlaw wrote: When .import parses an empty field in the csv file, that is , a comma immediately followed by another comma, is the cell, in the database, that corresponds to the empty field a NULL cell? Robert, No, it inserts a text field containing an empty string. All the fields

[sqlite] May one software write to the SQLite database while a other read the same SQLite database ?

2008-01-23 Thread Pierre8r
Hello, One SQLite database on my PC. Two softwares. May one software write to the SQLite database while a other read the same SQLite database ? Thanks, Pierre8r - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Query problem

2008-01-23 Thread Dennis Cote
Yasir Nisar wrote: Hi, Hope you will find this mail in the best of your health. SELECT * FROM BackupTable,BackupItemTable,BackItUpPathTable WHERE lower(BackItUpPathTable.WinName) GLOB lower("*1[]1.txt*") AND BackupItemTable.BKItemSize > -1 AND BackupTable.BackupNo =

Re: [sqlite] May one software write to the SQLite database while a other read the same SQLite database ?

2008-01-23 Thread drh
Pierre8r <[EMAIL PROTECTED]> wrote: > Hello, > > One SQLite database on my PC. > Two softwares. > May one software write to the SQLite database while a other read the > same SQLite database ? > Your programs cannot be reading and writing at exactly the same instant in time. But both programs

[sqlite] Re: May one software write to the SQLite database while a other read the same SQLite database ?

2008-01-23 Thread Igor Tandetnik
Pierre8r <[EMAIL PROTECTED]> wrote: One SQLite database on my PC. Two softwares. May one software write to the SQLite database while a other read the same SQLite database ? Not at the exact same time. The database file is essentially protected by multiple-readers-single-writer lock. But the

Re: [sqlite] May one software write to the SQLite database while a other read the same SQLite database ?

2008-01-23 Thread Pierre8r
Thanks for the quick answers. Pierre8r - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Query problem

2008-01-23 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: >> > SQLite seems to do the following: > > The glob syntax supports the following patterns: > ? - matches any single character > * - matches zero or more characters > [seq] - matches any single character in seq > [!seq] - matches any

[sqlite] How to truncate the hour fraction

2008-01-23 Thread Joanne Pham
Hi All, I have a hour table which has the startTime are stored at GMT time. The startTime of this hour table has the values below: Hour table --- StartTimeequivalent with the time format 1201561200 -> 2008-01-28 15:00:00 120159 -> 2008-01-28 23:00:00 120159

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Ken
assuming your time is in seconds. try t1: 201561222 -> 2008-01-28 15:00:22 and you want t2: 1201561200 -> 2008-01-28 15:00:00 t1 = t2 - (t2 mod 3600) Joanne Pham <[EMAIL PROTECTED]> wrote: Hi All, I have a hour table which has the startTime are stored at GMT time. The

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Joanne Pham
Thank Ken, But this is not what I want. I would like to truncate the hour. So t1: 201561222 -> 2008-01-28 15:00:22 and I want t2 ? -> 2008-01-28 00:00:00 So I want to find out t2? which has no hour number. Thanks JP - Original Message From: Ken <[EMAIL PROTECTED]> To:

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Scott Baker
Joanne Pham wrote: Thank Ken, But this is not what I want. I would like to truncate the hour. So t1: 201561222 -> 2008-01-28 15:00:22 and I want t2 ? -> 2008-01-28 00:00:00 So I want to find out t2? which has no hour number. So you just want the date (i.e. No time at all)?

[sqlite] Journal Files

2008-01-23 Thread Mark Riehl
I'm working with version 3.5.2 under Linux. I've got a database that is being shared between two processes and I'm running into issues with the journal file that doesn't go away. When that happens, one process appears to have the lock on the database and the other process is essentially locked

Re: [sqlite] .import NULL

2008-01-23 Thread Robert Wishlaw
On Jan 23, 2008 7:54 AM, Dennis Cote <[EMAIL PROTECTED]> wrote: > Robert Wishlaw wrote: > > When .import parses an empty field in the csv file, that is , a comma > > immediately followed by another comma, is the cell, in the database, > > that corresponds to the empty field a NULL cell? > > >

Re: [sqlite] Journal Files

2008-01-23 Thread drh
"Mark Riehl" <[EMAIL PROTECTED]> wrote: > I'm working with version 3.5.2 under Linux. I've got a database that > is being shared between two processes and I'm running into issues with > the journal file that doesn't go away. When that happens, one process > appears to have the lock on the

Re: [sqlite] Query problem

2008-01-23 Thread drh
[EMAIL PROTECTED] wrote: > > > This appears to be slightly different than normal *nix globbing since > > SQLite uses '^' rather than '!' for the set inversion (if my reading of > > the source is correct). > > GLOB is suppose to exactly mimic Unix, except that SQLite does not > break pattern

RE: [sqlite] Query problem

2008-01-23 Thread James Dennett
DRH wrote: > > Experiments using bash indicate that either ^ or ! is accepted > as the negation of a character set. Hence, > > ls -d [^tu]* > ls -d [!tu]* > > both return the same thing - a list of all files and directories > in the current directory whose names do not begin with "t"

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Joanne Pham
Any help for this question please! I would like to convert from t1 to t2. and my table is store t2. t1: 201561222 -> 2008-01-28 15:00:22 and I want t2 ?-> 2008-01-28 00:00:00 Thanks JP - Original Message From: Joanne Pham <[EMAIL PROTECTED]> To:

Re: [sqlite] Performance degradation after 3.3.17 -> 3.5.4 upgrade

2008-01-23 Thread Alexander Batyrshin
On Jan 21, 2008 12:58 AM, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > On Jan 20, 2008 11:32 PM, <[EMAIL PROTECTED]> wrote: > > "Alexander Batyrshin" <[EMAIL PROTECTED]> wrote: > > > Hello everyone. > > > I've discover performance degradation due to update 3.3.17 -> 3.5.4. > > > This SQL

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Scott Baker
Joanne Pham wrote: Any help for this question please! I would like to convert from t1 to t2. and my table is store t2. t1: 201561222 -> 2008-01-28 15:00:22 and I want t2 ?-> 2008-01-28 00:00:00 I think your numbers got cutoff... you mean 1201561222 right? Anyway try this:

Re: [sqlite] Query problem

2008-01-23 Thread Dennis Cote
[EMAIL PROTECTED] wrote: You can escape characters using [..]. To match a * anywhere in a string, for example: x GLOB '*[*]*' The [..] pattern must contain at least one internal character. So to match a "]" you can use the pattern x GLOB '*[]]*' So to match the OP's original string he would

Re: [sqlite] How to truncate the hour fraction

2008-01-23 Thread Clark Christensen
sqlite> select datetime('1201561222', 'unixepoch'); 2008-01-28 23:00:22 OK, so now it's clear your values are Unix times. sqlite> select strftime('%s', date('1201561222', 'unixepoch')); 1201478400 Effectively strips the time portion of your time value sqlite> select datetime('1201478400',

Re: [sqlite] Query problem

2008-01-23 Thread John Stanton
[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: This appears to be slightly different than normal *nix globbing since SQLite uses '^' rather than '!' for the set inversion (if my reading of the source is correct). GLOB is suppose to exactly mimic Unix, except that SQLite does not break

RE: [sqlite] Query problem

2008-01-23 Thread James Dennett
> -Original Message- > From: Dennis Cote [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 23, 2008 2:22 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Query problem > > [EMAIL PROTECTED] wrote: > > > > You > > can escape characters using [..]. To match a * anywhere in a

Re: [sqlite] Query problem

2008-01-23 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Experiments using bash indicate that either ^ or ! is accepted as the negation of a character set. Hence, ls -d [^tu]* ls -d [!tu]* both return the same thing - a list of all files and directories in the current directory whose names do not begin with "t" or

Re: [sqlite] Performance degradation after 3.3.17 -> 3.5.4 upgrade

2008-01-23 Thread drh
"Alexander Batyrshin" <[EMAIL PROTECTED]> wrote: > On Jan 21, 2008 12:58 AM, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > > On Jan 20, 2008 11:32 PM, <[EMAIL PROTECTED]> wrote: > > > "Alexander Batyrshin" <[EMAIL PROTECTED]> wrote: > > > > Hello everyone. > > > > I've discover performance

Re: [sqlite] Query problem

2008-01-23 Thread Dennis Cote
James Dennett wrote: Square brackets don't "escape" thing that way: [[] is a character class containing only the character '['. [][], however, is a character class containing two characters. The special rule is that the first character after the opening '[' is part of the class even if it's a

RE: [sqlite] Query problem

2008-01-23 Thread James Dennett
> -Original Message- > From: Dennis Cote [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 23, 2008 3:08 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Query problem > > James Dennett wrote: > > > > Square brackets don't "escape" thing that way: [[] is a character class > >

[sqlite] sqlite 3.5.2 for 32 bits and 64 bits

2008-01-23 Thread Joanne Pham
Hi All, I already had the sqlite library for 32 bits as libsqlite3.so.0.86 and now I want to build the sqlite library for 64bits for 64bits machine. Can someone help me with the information how to build the sqlite library which is used for 64bits machine. Thanks in advance for your help. JP

[sqlite] order by issue?

2008-01-23 Thread Ken
I'm not sure if this a bug or if working as intended: the order by b,a seems to cause B to use asc.. Instead of the desc as written in the order by statement. create table tst (a integer, b integer ); sqlite> insert into tst values(1,1); sqlite> insert into tst values(1,2); sqlite> insert

Re: [sqlite] Query problem

2008-01-23 Thread Dennis Cote
James Dennett wrote: The POSIX/Single Unix Spec documentation for fnmatch might be a good source, but I agree with the idea that SQLite should just document what it does rather than assuming that there's a universal standard for globbing. I think the most direct documentation I have found so

RE: [sqlite] order by issue?

2008-01-23 Thread James Dennett
> -Original Message- > From: Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 23, 2008 4:10 PM > To: sqlite > Subject: [sqlite] order by issue? > > I'm not sure if this a bug or if working as intended: > > the order by b,a seems to cause B to use asc.. Instead of the desc as >

RE: [sqlite] order by issue?

2008-01-23 Thread Lee Crain
Unless I don't know SQL, the results look correct. Anyone chime in to correct me. Your query: select * from tst order by b, a desc; Is really: select * from tst order by b ASC, a desc; So, if you look at the rows from top to bottom, you'll see that for each value of 'b' in ascending order, you

Re: [sqlite] order by issue?

2008-01-23 Thread Dennis Cote
Ken wrote: the order by b,a seems to cause B to use asc.. Instead of the desc as written in the order by statement. Ken, You would need to say order by b desc, a desc to get the behaviour you expect. HTH Dennis Cote

Re: [sqlite] order by issue?

2008-01-23 Thread Scott Baker
Ken wrote: I'm not sure if this a bug or if working as intended: the order by b,a seems to cause B to use asc.. Instead of the desc as written in the order by statement. create table tst (a integer, b integer ); sqlite> insert into tst values(1,1); sqlite> insert into tst values(1,2);

Re: [sqlite] SQLite omit using index

2008-01-23 Thread drh
"Alexander Batyrshin" <[EMAIL PROTECTED]> wrote: > Hello All, > I've found that SQLite-3.5.4 doesnt use index in this situation: > > sqlite> create table t1 (id int primary key, val int); > sqlite> create table t2 (id unique, val int primary key); > sqlite> explain query plan update t1 set val =

[sqlite] Foreign Constraint Triggers Across Attached Databases

2008-01-23 Thread scott_mcdonald
I have been trying to implement the paradigm of using Triggers to emulate referential integrity, for example cascading updates and deletes between two database tables. This works when the two database tables are in “main” but when I try to create the triggers between database tables in

Re: [sqlite] Query problem

2008-01-23 Thread Scott Hess
On Wed, Jan 23, 2008 at 3:23 PM, James Dennett <[EMAIL PROTECTED]> wrote: > The POSIX/Single Unix Spec documentation for fnmatch might be a good > source, but I agree with the idea that SQLite should just document what > it does rather than assuming that there's a universal standard for >