Re: [sqlite] question about case when

2008-07-11 Thread Igor Tandetnik
"Karthik" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A question about "case when" > > i have the following table > create table test( >id integer primary key, >category text, >rating integer > ) > the "rating" column takes value 1 to 5, > I need to get number of 1 to

Re: [sqlite] problem with simple select

2008-07-11 Thread Sean Riley
Aha! It turns out there was not a trailing space, but a trailing null character. The save code had a hard-coded size, something like: sqlite3_bind_text(g_objSaveStmt, 11, saveIdStr.c_str(), 16, SQLITE_STATIC); So when saveIdStr was less than 16 characters long, it was reading past the

Re: [sqlite] problem with simple select

2008-07-11 Thread Noah Hart
My guess is that there is a trailing space in the record. Try the following: sqlite> select save_id ||'<' from ae_objects where save_id like 165; 165< And see where the "sean" save_id field ends. Regards, Noah -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [sqlite] problem with simple select

2008-07-11 Thread Sean Riley
Thanks for the quick response. My application is using 3.4.1, but I grabbed the 3.5.9 executable and got the same thing. SQLite version 3.5.9 Enter ".help" for instructions sqlite> select * from ae_objects; 20086|sean|1|0|5.43301269412041|4.43301269412041|0.0|0.0|1|0|165|2 sqlite> select * from

[sqlite] Version 3.5.9 vs 3.5.2

2008-07-11 Thread Joanne Pham
Hi All, I am currently using the sqlite3 version 3.5.2 and we will have the release come in soon. So I am wondering if I need to upgrade my sqlite to version 3.5.9 before the release. If so then Can you please tell me why I need to upgrade to 3.5.9. At this time I need the buildin function

[sqlite] AIX I/O error on commit and MJ file missing.

2008-07-11 Thread Ken
Hi all, after running a transaction that copies data from an attached db into the main db, the commit returns an error 10. with a msg "disk I/O error" This is on AIX 5.3 and sqlite 3.5.9 (32bit compile) Other commits seem to be fine. (non attached commits to other db's ) Even stranger is

Re: [sqlite] problem with simple select

2008-07-11 Thread Noah Hart
Sean, what version of sqlite are you using? With the command line version it appears to work under 3.5.9 SQLite version 3.5.9 Enter ".help" for instructions sqlite> DROP TABLE if exists ae_objects ; sqlite> CREATE TABLE ae_objects ( ...> oid INTEGER PRIMARY KEY, ...>

[sqlite] problem with simple select

2008-07-11 Thread Sean Riley
Hello, I have a strange issue with a seemingly simple query. The table schema: CREATE TABLE ae_objects ( oid INTEGER PRIMARY KEY, nameVARCHAR(64), template_id INTEGER, template_module_id INTEGER, pos_x FLOAT, pos_y

Re: [sqlite] patch to allow integer rtree keys

2008-07-11 Thread Steve Friedman
Filip Navara wrote: > how about actually attaching the patch? :) > > - Filip > > On Fri, Jul 11, 2008 at 9:23 PM, Steve Friedman <[EMAIL PROTECTED]> wrote: >> I've just started using the rtree extension, and have found that the 32-bit >> float for the range keys is not appropriate for me.

Re: [sqlite] error from sqlite3_get_table

2008-07-11 Thread D. Richard Hipp
On Jul 11, 2008, at 1:45 PM, Gregor Brandt wrote: > I get and SQLITE_ERROR code form sqlite3_get_table. Upon checking > sqlite3_errcode and sqlite3_errmsg I get 0 and 'not an error'. Quoting from the documentation: "The sqlite3_get_table() interface is implemented as a wrapper around

[sqlite] error from sqlite3_get_table

2008-07-11 Thread Gregor Brandt
I get and SQLITE_ERROR code form sqlite3_get_table. Upon checking sqlite3_errcode and sqlite3_errmsg I get 0 and 'not an error'. The command SELECT * FROM `alarm_history` ORDER BY `alarm_id`; is very simple and most of the time it workswhy am I getting an error occasionally? Gregor

[sqlite] incorrect output of .timer during long operation

2008-07-11 Thread Steve Friedman
Per gcc 4.1.2 (on fedora core 8, at least), tv_usec and tv_sec are long ints. Thus, the computation in timeDiff (see below) overflows if the computation takes more than around 2147 seconds. I propose the following patch to shell.c. (Alternatively, a test can be made to see if the system

[sqlite] Do I need to free results variables?

2008-07-11 Thread Tim Streater
If I have something like the following PHP: $dbh = new PDO ("sqlite:" . $somename); $resq = $dbh->query ("select * from some_table"); $rest = $resq->fetchAll (); then do I need to do any cleanup on $resq before re-using it, such as setting to NULL (seems to be recommended for reuse of $dbh)?

[sqlite] multithreaded app and reload from disk for second db handle? [repost]

2008-07-11 Thread Markus Lehmann
[re-repost after initial e-mail was mangled up with HTML/XML tags and second was cut short by webmail client. Let's hope yahoo gets it right.] hi, Just to let you know. I did some more tests regarding the reload from disk and skimmed through the source code. Here a quick description of how

[sqlite] multithreaded app and reload from disk for second db handle? [repost]

2008-07-11 Thread Markus Lehmann
[repost after initial e-mail was mangled up with HTML/XML tags] hi, Just to let you know. I did some more tests and skimmed through the source code. Here a quick description of how the reloading from disk works in a multithreaded process: (1) If shared cache is disabled, each call to

[sqlite] In-memory database (:memory:) shared between mutlipe threads in same process?

2008-07-11 Thread Markus Lehmann
hi, [repost after earlier posting was mangled up with some HTML tags] I did some tests with the in-memory database and didn't find any way to use the in-memory database from multiple db handles in the same process. Having this capability would enable a multithreaded application to have e.g.