[sqlite] problems compiling 3.2.6

2005-09-19 Thread Cariotoglou Mike
I tried to compile 3.2.6 locally, using visual c 6, as I do with all sqlite releases. this version introduces a couple of changes that do not compile: os_win.c(482) : error C2065: 'INVALID_SET_FILE_POINTER' : undeclared identifier vdbeapi.c(237) : error C2520: conversion from unsigned __int64 to

[sqlite] Using date fields in SQLiteExplorer

2005-09-19 Thread Zibetti Paolo
Here is another question about dates and SQLiteExplorer (v 1.7). I'm storing dates in the native Delphi format, i.e. as floating point numbers ("dates as text" = FALSE). Whenever I try to update a record that contains such a date, SQLiteExplorer displays the message "unexpected count of affected

RE: [sqlite] Using date fields in SQLiteExplorer

2005-09-19 Thread Cariotoglou Mike
it is definitely possible. how have you defined the data type in the CREATE statement ? how did the data was inserted in the table initially ? have you enabled the "use datatypes" option ? dump the contents of the table with the "datatypes" disabled, so you see raw data. are they really

[sqlite] binding ORDER BY

2005-09-19 Thread njhinder
I am trying to 'ORDER BY ?' in my query because I would like to bind the order by criteria later in my code. This always fails on sqlite3_prepare() with an error, "ORDER BY terms must be non-integer constants". Do you have any suggestions on how I can use a variable in my ORDER BY clause?

Re: [sqlite] binding ORDER BY

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 09:42 -0500, [EMAIL PROTECTED] wrote: > I am trying to 'ORDER BY ?' in my query because I would like to bind the > order by criteria later in my code. This always fails on sqlite3_prepare() > with an error, "ORDER BY terms must be non-integer constants". Do you have > any

RE: [sqlite] problems compiling 3.2.6

2005-09-19 Thread Drew, Stephen
Mike, 3.2.6 compiles fine in Visual Studio 7 (.NET 2003). I can give it a go in my copy of Visual Studio 6 if you like... Steve -Original Message- From: Cariotoglou Mike [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 10:14 To: sqlite-users@sqlite.org Subject: [sqlite] problems

RE: [sqlite] problems compiling 3.2.6

2005-09-19 Thread Drew, Stephen
Further update: I get both these errors in Visual Studio 6. As you say, I think the first is just that Visual Studio 6 has a missing definition in winbase.h. I agree with you that it is in the documentation (perhaps a check could be performed and it defined if it doesn't exist...) The second

[sqlite] help with GROUP BY

2005-09-19 Thread Puneet Kishor
I have a table like so... SELECT title, date, speed FROM table ORDER BY title titledatespeed -- - 2484312030 2005-04-01 * 2484312030 2005-04-02 * 2484312030

RE: [sqlite] problems compiling 3.2.6

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 17:25 +0100, Drew, Stephen wrote: > As you say, I think the first is just that Visual Studio 6 has a missing > definition in winbase.h. I agree with you that it is in the > documentation (perhaps a check could be performed and it defined if it > doesn't exist...) > > The

[sqlite] DEFAULT PAGE SIZE option = malformed database schema

2005-09-19 Thread Guillaume Fougnies
Hello, During the upgrade from 3.2.5 to 3.2.6, i removed my compile time option SQLITE_DEFAULT_PAGE_SIZE. 3.2.6 is not able to access anymore to databases !?! SQLite version 3.2.6 Enter ".help" for instructions sqlite> .schema Error: malformed database schema SQLite version 3.2.6 Enter ".help"

[sqlite] Multiple Threads and Transactions

2005-09-19 Thread Iulian Popescu
Hello, I'm kind of new to the SQLite. I'm running an instance of the database in memory. I'm trying to figure out if the transaction isolation is also valid between threads. To give a concrete example, two threads as part of the same process share the same database connection. Suppose a

[sqlite] query problem

2005-09-19 Thread Alain Bertrand
hi all, I am porting a program from mysql to sqlite. The following statement doesn't work correctly with sqlite though it does with mysql. SELECT COUNT(*) AS nb FROM ttd_photos LEFT JOIN ttd_trees ON ttd_photos.kind=1 AND ttd_photos.refId=ttd_trees.treeId LEFT JOIN ttd_pots ON ttd_photos.kind=2

Re: [sqlite] query problem

2005-09-19 Thread Puneet Kishor
On Sep 19, 2005, at 12:36 PM, Alain Bertrand wrote: hi all, I am porting a program from mysql to sqlite. The following statement doesn't work correctly with sqlite though it does with mysql. SELECT COUNT(*) AS nb FROM ttd_photos LEFT JOIN ttd_trees ON ttd_photos.kind=1 AND

Re: [sqlite] DEFAULT PAGE SIZE option = malformed database schema

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 19:04 +0200, Guillaume Fougnies wrote: > Hello, > > During the upgrade from 3.2.5 to 3.2.6, i removed my > compile time option SQLITE_DEFAULT_PAGE_SIZE. > > 3.2.6 is not able to access anymore to databases !?! > SQLite version 3.2.6 > Enter ".help" for instructions >

Re: [sqlite] help with GROUP BY

2005-09-19 Thread Jay Sprenkle
You need a unique field in your table to do this right. I used title here. This is the idea: SELECT a.title, b.date, a.mx FROM ( SELECT title, date, MAX(speed) AS mx FROM tbl GROUP BY title, date ) AS a INNER JOIN ( SELECT title, date, MAX(speed) AS mx FROM tbl GROUP BY title, date

Re: [sqlite] Multiple Threads and Transactions

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 13:27 -0400, Iulian Popescu wrote: > Hello, > > > > I'm kind of new to the SQLite. I'm running an instance of the database in > memory. I'm trying to figure out if the transaction isolation is also valid > between threads. To give a concrete example, two threads as part

Re: [sqlite] help with GROUP BY

2005-09-19 Thread Kurt Welgehausen
> I want the title, the MAX(speed) for each title group, and the date > that occurred. In case, ... I haven't tried this, but I think it's correct. Let me know if it's not. select distinct table.title, table.date, t2.maxsp from table, (select title ttl, max(speed) maxsp from table

[sqlite] Re: query problem

2005-09-19 Thread Alain Bertrand
Puneet Kishor a écrit : without seeing the data, a good guess would be, "Yes." What do you mean ? That my query is syntaxically wrong ? LEFT JOIN selects all the rows with values from the left table and either matching values or NULL from the right table. Yes, I know, not very well because

Re: [sqlite] DEFAULT PAGE SIZE option = malformed database schema

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 13:42 -0400, D. Richard Hipp wrote: > On Mon, 2005-09-19 at 19:04 +0200, Guillaume Fougnies wrote: > > Hello, > > > > During the upgrade from 3.2.5 to 3.2.6, i removed my > > compile time option SQLITE_DEFAULT_PAGE_SIZE. > > > > 3.2.6 is not able to access anymore to

Re: [sqlite] help with GROUP BY

2005-09-19 Thread Puneet Kishor
Kurt Welgehausen wrote: I want the title, the MAX(speed) for each title group, and the date that occurred. In case, ... I haven't tried this, but I think it's correct. Let me know if it's not. select distinct table.title, table.date, t2.maxsp from table, (select title ttl,

Re: [sqlite] Re: query problem

2005-09-19 Thread Puneet Kishor
Alain Bertrand wrote: Puneet Kishor a écrit : without seeing the data, a good guess would be, "Yes." What do you mean ? That my query is syntaxically wrong ? Your query is syntactically correct in that it returns a result without the SQL engine generating a syntax error... it just doesn't

[sqlite] Sqlite.dll killing Tcl?

2005-09-19 Thread Dinsmore, Jeff
I have a little wrapped Tcl server app that uses sqlite.dll via the Tcl API. Tcl version: 8.4.9 Sqlite version: 2.8.6 Running on Windows 2003 Server. Every once in a while, the server will die - and it looks like sqlite.dll is doing the killing. There are two different processes that

Re: [sqlite] query problem

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 19:36 +0200, Alain Bertrand wrote: > hi all, > > I am porting a program from mysql to sqlite. > The following statement doesn't work correctly with sqlite though it does > with mysql. > SELECT COUNT(*) AS nb FROM ttd_photos LEFT JOIN ttd_trees ON > ttd_photos.kind=1 AND

Re: [sqlite] DEFAULT PAGE SIZE option = malformed database schema

2005-09-19 Thread Guillaume Fougnies
Ok, i saw the Check-in #2724. You should make in pager.h: #if SQLITE_DEFAULT_PAGE_SIZE > SQLITE_MAX_PAGE_SIZE #error "blah blah" #endif Mon, Sep 19, 2005 at 02:53:53PM -0400: D. Richard Hipp wrote: > On Mon, 2005-09-19 at 13:42 -0400, D. Richard Hipp wrote: > > On Mon, 2005-09-19 at 19:04

Re: [sqlite] Sqlite.dll killing Tcl?

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 14:15 -0500, Dinsmore, Jeff wrote: > I can't reproduce the failure, so it's difficult to fix the problem > S, I'm asking the experts. > > Have any of you seen anything like this? > Nothing comes to mind. But you are running a 2 year old version of SQLite. The

Re: [sqlite] help with GROUP BY

2005-09-19 Thread Jay Sprenkle
> > > SELECT t.title, t.date, t.speed > FROM table t JOIN ( > SELECT title, MAX(speed) maxsp > FROM table > GROUP BY title) t2 ON t.title = t2.title > WHERE t.speed = t2.maxsp > ORDER BY t.title > > Couldn't have done without your suggestion. Here's a virtual 22 oz. of > cold, local Wisconsin

RE: [sqlite] Multiple Threads and Transactions

2005-09-19 Thread Iulian Popescu
Thank you very much for the answer and I apologize for my misconception. My confusion came from the fact the database handle was used by two different threads and one of them was executing operations inside a transaction. Is that possible to obtain more than one handle to the same in memory

Re: [sqlite] query problem

2005-09-19 Thread Kervin L. Pierre
D. Richard Hipp wrote: Hence, the result set contains no rows. A COUNT() of a empty result set gives NULL. I thought per the last discussion on "Sum and NULL" that the count of an empty set would return zero. Regards, Kervin

Re: [sqlite] query problem

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 16:06 -0400, Kervin L. Pierre wrote: > D. Richard Hipp wrote: > > Hence, the result set contains no rows. A COUNT() of a empty result > > set gives NULL. > > I thought per the last discussion on "Sum and NULL" > that the count of an empty set would return zero. > You're

Re: [sqlite] query problem

2005-09-19 Thread D. Richard Hipp
On Mon, 2005-09-19 at 15:19 -0400, D. Richard Hipp wrote: > On Mon, 2005-09-19 at 19:36 +0200, Alain Bertrand wrote: > > hi all, > > > > I am porting a program from mysql to sqlite. > > The following statement doesn't work correctly with sqlite though it does > > with mysql. > > SELECT COUNT(*)

[sqlite] Re: - Re: [sqlite] query problem

2005-09-19 Thread rbundy
No. COUNT(*) of an empty result returns 0. COUNT(*) should always return an integer value, never NULL. It is a row-based, rather than a column-based, aggregate function. rayB |-+> | | "D. Richard Hipp"| | | <[EMAIL

RE: [sqlite] query problem

2005-09-19 Thread Cariotoglou Mike
You are correct. I just run a test on 3.2.6 release, and it does handle joins incorrectly. I cant get the files from cvs, so I am not sure whether the fix also Handles the reverse situation: Select * >From T1 left join t2 on (t1.ref=t2.id) and (t2.kind=1) Ie if there is a join term that

[sqlite] trigger question

2005-09-19 Thread Jim McNamara
Hi- This syntax isnt working. I cant figure out what i am doing wrong. I created a budget calculator with a sqlite java wrapper/driver. I am trying to make it a little easier to use. thanks for any tips! jim CREATE TRIGGER fki_statusDetail_statusMaster_id BEFORE INSERT ON Status_Detail FOR

Re: [sqlite] trigger question

2005-09-19 Thread Jim McNamara
Hi- i tried a different dll and sql tool. the trigger worked. i tried a trick and it seems to work. what i did is put the trigger in under the new dll and new sql tool and then copy the updated db (now with a trigger) to my project directory that uses the java wrapper/driver. it is

[sqlite] Re: query problem

2005-09-19 Thread Alain Bertrand
D. Richard Hipp a écrit : I've changed my mind. I think instead that there is a bug in SQLite that caused LEFT JOINs to be computed incorrectly if one of the terms in the ON clause restricts only the left table in the join. Check-in [2725] at

[sqlite] Storing RTF text in a field

2005-09-19 Thread Gaurav Patole
Hello, I have the following table CREATE TABLE Tasks(taskID INTEGER PRIMARY KEY, parentTaskID INTEGER, projID INTEGER, name varchar(25), assignee varchar(25), start_date timestamp, end_date timestamp, completed_date timestamp, last_edited timestamp, created_date timestamp,