[sqlite] |2.8.17] How to compile on Linux?

2008-01-28 Thread Gilles
Hello Since PHP5's embedded SQLite is 2.8.17, I downloaded the CLI client sqlite-2.8.17.bin.gz from the "Historical Binaries And Source Code" section of the site, but it also requires the lib.so to work. Problem is, sqlite-source-2_8_17.zip only contains the .c files, not a Makefile. How

[sqlite] Number of elements in IN clause

2008-01-28 Thread Felix Radensky
Hi, Is there any limitation on the number of elements in IN clause ? Can one have, e.g. thousands of elements ? Also, can having to many elements become inefficient at some point and one has to use some other technique, i.e. comparing elements one by one in a loop ? Thanks in advance. Felix.

RE: [sqlite] Number of elements in IN clause

2008-01-28 Thread RB Smissaert
>SELECT * FROM maintable WHERE key IN stuff; Thanks for that tip. Didn't know you could do that. Can't remember this as standard SQL. RBS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 28 January 2008 12:40 To: sqlite-users@sqlite.org Subject: Re:

Re: [sqlite] Number of elements in IN clause

2008-01-28 Thread drh
Felix Radensky <[EMAIL PROTECTED]> wrote: > Hi, > > Is there any limitation on the number of elements in IN clause ? > Can one have, e.g. thousands of elements ? Also, can having > to many elements become inefficient at some point and one > has to use some other technique, i.e. comparing

Re: [sqlite] Number of elements in IN clause

2008-01-28 Thread drh
"Samuel R. Neff" <[EMAIL PROTECTED]> wrote: > I don't think it is standard SQL. At the very least, it doesn't work in > MSSQL. Standard is > > SELECT * FROM maintable WHERE key IN (select x from stuff); > > SQLite shortened version is much nicer.. wish it was standard. > SQLite also

RE: [sqlite] Number of elements in IN clause

2008-01-28 Thread Fowler, Jeff
Just experimented with the short-hand version. It seems to work only when the "stuff" table has a single field, although the field name doesn't matter. More than one field causes a query error, even if the field name being compared is in the table. I've actually never seen this notation, but it

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Nicolas Williams
On Mon, Jan 28, 2008 at 10:07:01AM +0100, Ralf Junker wrote: > Hello Bharath Booshan L, > > >>select * from t where filepath regexp '/MyMovie(\.[^\.]+)*$'; > > > >Will this query use index, if we had one, on filepath? > > No. It will do a full table scan. But it could, no? I suppose that to

RE: [sqlite] Number of elements in IN clause

2008-01-28 Thread Fowler, Jeff
Yes, this is standard SQL. The syntax is: SELECT * from maintable where key IN (SELECT key from anothertable) -Original Message- From: RB Smissaert [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 7:54 AM To: sqlite-users@sqlite.org Subject: RE: [sqlite] Number of elements in

Re: [sqlite] SQLite Compilation Problems on FreeBSD

2008-01-28 Thread Frederic de la Goublaye
Hi I succeed in the compilation of SQLite under FreeBSD 5.4. This is the French documentation I wrote: http://fredericdelagoublaye.free.fr/freebsd/install/sqlite.html I hope you will find some clues to help you Best Regards Frédéric de la Goublaye On Jan 28, 2008 5:25 PM, Rob Sciuk <[EMAIL

Re: [sqlite] |2.8.17] How to compile on Linux?

2008-01-28 Thread Kees Nuyt
On Mon, 28 Jan 2008 09:59:40 +0100, Gilles <[EMAIL PROTECTED]> wrote: >Hello > >Since PHP5's embedded SQLite is 2.8.17, I downloaded the CLI client >sqlite-2.8.17.bin.gz from the "Historical Binaries And Source Code" section >of the site, but it also requires the lib.so to work. > >Problem is,

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread drh
Nicolas Williams <[EMAIL PROTECTED]> wrote: > On Mon, Jan 28, 2008 at 10:07:01AM +0100, Ralf Junker wrote: > > Hello Bharath Booshan L, > > > > >>select * from t where filepath regexp '/MyMovie(\.[^\.]+)*$'; > > > > > >Will this query use index, if we had one, on filepath? > > > > No. It will do

RE: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread James Dennett
> -Original Message- > From: Nicolas Williams [mailto:[EMAIL PROTECTED] > Sent: Monday, January 28, 2008 10:35 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] How to specify regular expression in a query? > > On Mon, Jan 28, 2008 at 06:22:08PM +0100, Ralf Junker wrote: > > I

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Nicolas Williams
On Mon, Jan 28, 2008 at 06:22:08PM +0100, Ralf Junker wrote: > I believe that this API would also ease implementations of Unicode > LIKE and GLOB. That's what I was thinking of. The Unicode extensions work by redefining the like, glob and regexp functions, and by adding collations. But surely

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Ralf Junker
Hello Nicolas Williams, >I suppose that to make this generic so that users can replace the >regexp, like, and glob functions would require some new interfaces. I believe so, too. The like and glob optimization is part of where.c and outside the reach of sqlite3_create_function(). >SQLite would

[sqlite] SQLite 3.4.x to 3.5.x drop-in compatibility?

2008-01-28 Thread Carl Gundel
Hey all, I'm thinking about upgrading to v3.5.4 the latest SQLite from v3.4.0 for the next release of Run BASIC, and I'm wondering about a couple of things: 1) Do I need to change the way I make calls to the database engine? Is the API the same? I probably wouldn't have too much trouble

[sqlite] Re: About designing a query in sqlite3-style

2008-01-28 Thread A.J.Millan
My mistake: Of course, in the design A, the resp in while (resp == xxx) refers to the result in the prepare statement sqlite3_prepare_v2() Adolfo - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] SQLite and OS X - Can I have multiple versions?

2008-01-28 Thread P Kishor
On 1/28/08, Carl Gundel <[EMAIL PROTECTED]> wrote: > > As I understand it, Apple's Mac OS X comes with SQLite as part of its Mail > app. It is not so much that "OS X comes with SQLite" as part of its Mail.app. It is more like OS X allows one to create persistent data stores using multiple

RE: [sqlite] Number of elements in IN clause

2008-01-28 Thread Samuel R. Neff
I don't have PostrgreSQL installed, but the docs say IN requires a subquery. http://www.postgresql.org/docs/8.2/interactive/functions-subquery.html MySQL does not support this syntax either (that one I tested). Sam --- We're Hiring! Seeking a

Re: [sqlite] SQLite Compilation Problems on FreeBSD

2008-01-28 Thread Rob Sciuk
On Sun, 27 Jan 2008, L. S. wrote: Why doesn't SQLite 3.5.4 compile under FreeBSD 5.3? Can it be done in a sane manner? AFAIK, it just works, but you may require the -lc_r option to include the re-entrant (threadsafe) C library with your linked executeable ... How can I link against

RE: [sqlite] Number of elements in IN clause

2008-01-28 Thread Samuel R. Neff
I don't think it is standard SQL. At the very least, it doesn't work in MSSQL. Standard is SELECT * FROM maintable WHERE key IN (select x from stuff); SQLite shortened version is much nicer.. wish it was standard. Sam --- We're Hiring!

[sqlite] About designing a query in sqlite3-style

2008-01-28 Thread A.J.Millan
Hi: Assuming that the definition of the dBase does not change, I wonder if the two pseudo code schemas are equally valid or if there are pros and cons in each one: // Design -A- do { // Compile the statement into a virtual machine resp =

[sqlite] SQLite and OS X - Can I have multiple versions?

2008-01-28 Thread Carl Gundel
As I understand it, Apple's Mac OS X comes with SQLite as part of its Mail app. Is there some way to leverage this to avoid distributing SQLite with Mac apps? Has anyone tried this, or is it a bad idea? I'm assuming that I can have my own copy of SQLite packaged with my OS X application and it

Re: [sqlite] SQLite and OS X - Can I have multiple versions?

2008-01-28 Thread Carl Gundel
drh-2 wrote: > > "P Kishor" <[EMAIL PROTECTED]> wrote: >> >> Most folks though install their own version of SQLite under the >> /usr/local tree ... > > Why do people feel like they need SQLite to be a seperately > library? It is *designed* to be statically linked. Yes, but not everyone uses

Re: [sqlite] SQLite 3.4.x to 3.5.x drop-in compatibility?

2008-01-28 Thread drh
Carl Gundel <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm thinking about upgrading to v3.5.4 the latest SQLite from v3.4.0 for the > next release of Run BASIC, and I'm wondering about a couple of things: > > 1) Do I need to change the way I make calls to the database engine? Is the > API the

Re: [sqlite] SQLite and OS X - Can I have multiple versions?

2008-01-28 Thread drh
"P Kishor" <[EMAIL PROTECTED]> wrote: > > Most folks though install their own version of SQLite under the > /usr/local tree ... Why do people feel like they need SQLite to be a seperately library? It is *designed* to be statically linked. -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] SQLite and OS X - Can I have multiple versions?

2008-01-28 Thread Rick Langschultz
What I did was used the SQLite sources and added them into a Carbon framework. Then set sqlite3.h and the other source header to public. That way I could call the functions. Then i set the installation path to @executable_path/../Frameworks, then added a new copy phase and copied the

Re: [sqlite] SQLite and OS X - Can I have multiple versions?

2008-01-28 Thread P Kishor
On 1/28/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > "P Kishor" <[EMAIL PROTECTED]> wrote: > > > > Most folks though install their own version of SQLite under the > > /usr/local tree ... > > Why do people feel like they need SQLite to be a seperately > library? It is *designed* to be

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Ralf Junker
Hello Bharath Booshan L, >>select * from t where filepath regexp '/MyMovie(\.[^\.]+)*$'; > >Will this query use index, if we had one, on filepath? No. It will do a full table scan. Ralf - To unsubscribe, send email

[sqlite] Performance of Unique Index

2008-01-28 Thread Alexander Batyrshin
Hello All, Is there any difference in speed of access for unique and usual index? -- Alexander Batyrshin aka bash bash = Biomechanica Artificial Sabotage Humanoid - To unsubscribe, send email to [EMAIL PROTECTED]

[sqlite] Why does the FAQ example use 2 copies for adding/deleting a column

2008-01-28 Thread Lothar Scholz
Hello, The example for question 11 in the FAQ has this code for dropping an existing table column 'c' BEGIN TRANSACTION; CREATE TEMPORARY TABLE t1_backup(a,b); INSERT INTO t1_backup SELECT a,b FROM t1; DROP TABLE t1; CREATE TABLE t1(a,b); INSERT INTO t1 SELECT a,b FROM t1_backup; DROP TABLE

Re: [sqlite] Why does the FAQ example use 2 copies for adding/deleting a column

2008-01-28 Thread drh
Lothar Scholz <[EMAIL PROTECTED]> wrote: > Hello, > > The example for question 11 in the FAQ has this code for dropping an > existing table column 'c' > > BEGIN TRANSACTION; > CREATE TEMPORARY TABLE t1_backup(a,b); > INSERT INTO t1_backup SELECT a,b FROM t1; > DROP TABLE t1; > CREATE TABLE

[sqlite] Re: [unclassified] [sqlite] Re: Why does the FAQ example use 2 copies for adding/deleting a column

2008-01-28 Thread Lothar Scholz
Hello Igor, Tuesday, January 29, 2008, 9:06:56 AM, you wrote: IT> Lothar Scholz IT> wrote: >> This is copying the whole table twice. Is there any reason why it >> shouldn't be: >> >> BEGIN TRANSACTION; >> CREATE TEMPORARY TABLE t1_backup(a,b); >> INSERT INTO t1_backup SELECT a,b FROM t1; >>

[sqlite] Re: Why does the FAQ example use 2 copies for adding/deleting a column

2008-01-28 Thread Igor Tandetnik
Lothar Scholz wrote: This is copying the whole table twice. Is there any reason why it shouldn't be: BEGIN TRANSACTION; CREATE TEMPORARY TABLE t1_backup(a,b); INSERT INTO t1_backup SELECT a,b FROM t1; DROP TABLE t1; ALTER TABLE t1_backup RENAME TO t1; COMMIT; t1_backup is a temporary table.

[sqlite] Re: [unclassified] [sqlite] Re: Why does the FAQ example use 2 copies for adding/deleting a column

2008-01-28 Thread Igor Tandetnik
Lothar Scholz wrote: Transactions do not rewind drop table statements and other schema manipulations. That's not true. Schema changes, including DROP TABLE statemens, done within a transaction can be happily rolled back. Just try it and see. Igor Tandetnik

[sqlite] find the highest rank per group

2008-01-28 Thread P Kishor
I have id, name, .., title, rank 1, a, .., foo, 5 1, a, .., bar, 4 1, a, .., bar, 7 2, b, .., baz, 6 2, b, .., qux, 9 and so on I want 1, a, .., bar, 7 2, b, .., qux, 9 that is, all the rows for each name where title is the highest. SELECT id, name, .., title, MAX(rank) FROM table GROUP BY

RE: [sqlite] find the highest rank per group

2008-01-28 Thread Fowler, Jeff
Puneet, I'm assuming you meant to say "where rank is the highest" rather than title, as that's what your example shows. Here's the syntax: select * from table a where rank = (select max(rank) from table b where b.id = a.id) - Jeff -Original Message- From: P Kishor [mailto:[EMAIL

Re: [sqlite] Performance of Unique Index

2008-01-28 Thread Cory Nelson
On Jan 28, 2008 2:45 PM, Alexander Batyrshin <[EMAIL PROTECTED]> wrote: > Hello All, > Is there any difference in speed of access for unique and usual index? no, it is only a constraint when inserting. -- Cory Nelson

Re: [sqlite] find the highest rank per group

2008-01-28 Thread P Kishor
On 1/28/08, Fowler, Jeff <[EMAIL PROTECTED]> wrote: > Puneet, > > I'm assuming you meant to say "where rank is the highest" rather than > title, as that's what your example shows. indeed. > > Here's the syntax: > select * from table a > where rank = (select max(rank) from table b where b.id =

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Bharath Booshan L
Hello experts, How can I instruct GLOB function to perform case-insensitive search similar to LIKE. Can I? -- Bharath On 1/30/08 10:30 AM, "Bharath Booshan L" <[EMAIL PROTECTED]> wrote: > Thanks for the inputs experts, > > I am using SQLite 3.4.0 on Mac OS X Leapord, and using regexp in my

Re: [sqlite] How to specify regular expression in a query?

2008-01-28 Thread Bharath Booshan L
Thanks for the inputs experts, I am using SQLite 3.4.0 on Mac OS X Leapord, and using regexp in my query reports an error SQL error: no such function: regexp I tried to use the query using GLOB and another query which separates FilePath into Dirpath and FileName and uses LIKE comparison. Both