Re: [sqlite] Prepared Statement (select * from x where y in ());

2007-07-18 Thread Scott Hess
Long ago and far away, I build a database abstraction layer which used ?@ for this. So you'd say something like: stmt = prepare("select * from table where xyz in (?@)"); bind_array(stmt, 0, arrayRef); The library would take the array, quote each element, and separate them with commas. It w

Re: [sqlite] Prepared Statement (select * from x where y in ());

2007-07-18 Thread RaghavendraK 70574
May be my Q is not clear, Problem is as shown below, SQL = "select * from table where xyz in (:abc);" bind_text("'ab','xy','zx','123'") bind_text will append '' at the begining and at end making it as one string rather than ab,xy,zx. regards ragha *

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread Richard Klein
[EMAIL PROTECTED] wrote: John Stanton <[EMAIL PROTECTED]> wrote: Yes, each connection has a cache. A lot of concurrent connections means a lot of memory allocated to cache and potentially a lot of duplicated cached items. See shared cache mode for relief. Yes. But remember that shared

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread Richard Klein
John Stanton wrote: Richard Klein wrote: John Stanton wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. > Why is that? Is there a separate cache (I hope not!) for each connection? Th

Re: [sqlite] Prepared Statement (select * from x where y in ());

2007-07-18 Thread Bharath Booshan L
> 1)How can we prepare a SQliteStatement for the following type of select, > select * from tablename where column in (?); > ?: we don;t know the length of this string. Pass any value less than zero as 3rd parameter to sqlite3_prepare function, in which case, characters up to the first null

[sqlite] Prepared Statement (select * from x where y in ());

2007-07-18 Thread RaghavendraK 70574
HI, 1)How can we prepare a SQliteStatement for the following type of select, select * from tablename where column in (?); ?: we don;t know the length of this string. 2) Can we mix SqliteStatement and sqlite3_exec functions? regads ragha

Re: [sqlite] autoincrement and fts2?

2007-07-18 Thread Joe Wilson
--- Scott Hess <[EMAIL PROTECTED]> wrote: > S, as far as I can tell, this behaviour changed in October, with > http://www.sqlite.org/cvstrac/chngview?cn=3470 . Which is before fts2 > even existed! So fts2 has been broken in this way essentially > forever. *sigh*. [I'm not entirely clear why

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread drh
John Stanton <[EMAIL PROTECTED]> wrote: > > Yes, each connection has a cache. A lot of concurrent connections means > a lot of memory allocated to cache and potentially a lot of duplicated > cached items. See shared cache mode for relief. > Yes. But remember that shared cache mode has limit

Re: [sqlite] "Library routine called out of sequence" and user-defined aggregates

2007-07-18 Thread drh
<[EMAIL PROTECTED]> wrote: > John Stanton wrote: > > > Have you checked to ensure that you database handle is correct? > > Your function inherits it as user data, but is it corrupted? > > The db handle is passed correctly. > > I'm starting to suspect that this is a bug of sqlite. It is not a bu

Re: [sqlite] "Library routine called out of sequence" and user-defined aggregates

2007-07-18 Thread ggeeoo
John Stanton wrote: > Have you checked to ensure that you database handle is correct? > Your function inherits it as user data, but is it corrupted? The db handle is passed correctly. I'm starting to suspect that this is a bug of sqlite. Even a simple "select 0" fails inside an aggregate. Here'

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread John Stanton
Richard Klein wrote: John Stanton wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. > Why is that? Is there a separate cache (I hope not!) for each connection? Thanks, - Richard (new to t

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread John Stanton
[EMAIL PROTECTED] wrote: > A single connection can only be used by a single thread at > a time. If you have multiple threads running at the same > time, they each need to have their own connection. > > If you are not running on a Linux 2.4 kernel, then you can > pass connections from one thread

RE: [sqlite] mailing list slow?

2007-07-18 Thread Lodewijk Duymaer van Twist
I think that any e-mail should be delivered within a few seconds in this day and age. Also real time mailing should improve discussions on the mailing list. Just an opinion. Kind regards, Lodewijk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, Jul

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread Richard Klein
John Stanton wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. > Why is that? Is there a separate cache (I hope not!) for each connection? Thanks, - Richard (new to the group) -

Re: [sqlite] autoincrement and fts2?

2007-07-18 Thread Scott Hess
S, as far as I can tell, this behaviour changed in October, with http://www.sqlite.org/cvstrac/chngview?cn=3470 . Which is before fts2 even existed! So fts2 has been broken in this way essentially forever. *sigh*. [I'm not entirely clear why that change introduced this difference, but it d

Re: [sqlite] mailing list slow?

2007-07-18 Thread GBanschbach
I don't know about slow, but I wish getting on and off the list was *reliable* - ie: as advertised. I've been on other lists, and gotten off without too much effort. I'd like to be able to leave for now, and come back in a few months. But I seem to be stuck here forever. Any chance of gett

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread John Stanton
[EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. As far as we can ascertain avoiding fcntl

Re: [sqlite] mailing list slow?

2007-07-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joe Wilson wrote: > I noticed delays of an hour or so in posts hitting the mailing list recently. > Or is it just my mail server? Note that many people use greylisting on their mail servers which temporarily refuse mail from previously unseen senders/

Re: [sqlite] mailing list slow?

2007-07-18 Thread Alberto Simões
On 7/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: > I noticed delays of an hour or so in posts hitting the mailing list recently. > Or is it just my mail server? > The server (www.sqlite.org) seems to be doing OK. Load average is 0.13. Nothing unusua

Re: [sqlite] malloc failure in sqlite3_prepare

2007-07-18 Thread Rich Rattanni
Hi Dan Thanks for the kick in the butt :). I have been developing an application for the ARM platform (for which there is no valgrind port) but this application is running on an x86. I will try that and report back anything I find out. On 7/18/07, Dan Kennedy <[EMAIL PROTECTED]> wrote: >

RE: [sqlite] mailing list slow?

2007-07-18 Thread Lodewijk Duymaer van Twist
Same here -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 18, 2007 6:01 PM To: sqlite-users@sqlite.org Subject: [sqlite] mailing list slow? I noticed delays of an hour or so in posts hitting the mailing list recently. Or is it just my mail server?

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > A single connection can only be used by a single thread at > a time. If you have multiple threads running at the same > time, they each need to have their own connection. > > If you are not running on a Linux 2.4 kernel, then you can > pass connections from one thre

Re: [sqlite] mailing list slow?

2007-07-18 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > I noticed delays of an hour or so in posts hitting the mailing list recently. > Or is it just my mail server? > The server (www.sqlite.org) seems to be doing OK. Load average is 0.13. Nothing unusual in the logs. There are currently 1281 people on the mai

Re: [sqlite] sorting of blobs

2007-07-18 Thread John Stanton
Well done, you have answered the man's question. Joe Wilson wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Try looking at the SORT opcode. You can track it through the Sqlite source. OP_Sort doesn't sort any longer. It just does a rewind on the cursor. /* Opcode: Sort P1 P2 * ** **

Re: [sqlite] UPDATE during SELECT

2007-07-18 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > --- John Stanton <[EMAIL PROTECTED]> wrote: > > Using a single Sqlite connection for each database and holding the > > connection open means that maximum effect is obtained from Sqlite's > > cache. As far as we can ascertain avoiding fcntl removes any issu

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread John Stanton
Joe Wilson wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Using a single Sqlite connection for each database and holding the connection open means that maximum effect is obtained from Sqlite's cache. As far as we can ascertain avoiding fcntl removes any issues regarding multiple threads

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread Dan Kennedy
> > Can the SQLite authors confirm that simultaneous use of a single > connection by multiple reader threads is supported without external > mutexes? It is not supported. Dan. - To unsubscribe, send email to [EMAIL P

[sqlite] mailing list slow?

2007-07-18 Thread Joe Wilson
I noticed delays of an hour or so in posts hitting the mailing list recently. Or is it just my mail server? Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http:

Re: [sqlite] sorting of blobs

2007-07-18 Thread Joe Wilson
--- John Stanton <[EMAIL PROTECTED]> wrote: > Try looking at the SORT opcode. You can track it through the Sqlite source. OP_Sort doesn't sort any longer. It just does a rewind on the cursor. /* Opcode: Sort P1 P2 * ** ** This opcode does exactly the same thing as OP_Rewind except that ** it in

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread Joe Wilson
--- John Stanton <[EMAIL PROTECTED]> wrote: > Using a single Sqlite connection for each database and holding the > connection open means that maximum effect is obtained from Sqlite's > cache. As far as we can ascertain avoiding fcntl removes any issues > regarding multiple threads accessing a s

Re: [sqlite] "Library routine called out of sequence" and user-defined aggregates

2007-07-18 Thread John Stanton
Have you checked to ensure that you database handle is correct? Your function inherits it as user data, but is it corrupted? [EMAIL PROTECTED] wrote: I'm getting "Library routine called out of sequence" when I try to execute an insertion inside an aggregate that I have created myself. Here

Re: [sqlite] sorting of blobs

2007-07-18 Thread John Stanton
B V, Phanisekhar wrote: Assume I have an albumtable: create table albumtable (albumid INTEGER PRIMARY KEY, album BLOB); Now I do a query to return the entire albums in the albumtable table in alphabetical order: The instructions for the above query are given below: explain select

Re: [sqlite] REGEXP implementation with pcre

2007-07-18 Thread Alexey Tourbin
On Wed, Jul 11, 2007 at 09:07:39AM -0500, Neil Best wrote: > see code from original post at > http://article.gmane.org/gmane.comp.db.sqlite.general/23584 BTW, the code has been released under the same terms as SQLite itself. http://git.altlinux.org/people/at/packages/?p=sqlite3-pcre.git git://git.

Re: [sqlite] Re: UPDATE during SELECT

2007-07-18 Thread John Stanton
In our particular application we use Sqlite embedded in a multi-threaded application server. The databases are only accessed by that process. We compile Sqlite without the fcntl file locking and place a pthread read/write lock around accesses to the connection for each database. That way we ha

Re: [sqlite] sorting of blobs

2007-07-18 Thread Dan Kennedy
On Wed, 2007-07-18 at 16:03 +0530, B V, Phanisekhar wrote: > Assume I have an albumtable: > > create table albumtable (albumid INTEGER PRIMARY KEY, album BLOB); > > > > Now I do a query to return the entire albums in the albumtable table in > alphabetical order: > > > > The instructions fo

[sqlite] sorting of blobs

2007-07-18 Thread B V, Phanisekhar
Assume I have an albumtable: create table albumtable (albumid INTEGER PRIMARY KEY, album BLOB); Now I do a query to return the entire albums in the albumtable table in alphabetical order: The instructions for the above query are given below: explain select album from albumtable order b

Re: [sqlite] malloc failure in sqlite3_prepare

2007-07-18 Thread Dan Kennedy
> (gdb) bt > #0 0xb7d4899f in ?? () >from /lib/tls/i686/cmov/libc.so.6 > #1 0x0001 in ?? () > #2 0xb7f94ea3 in sqlite3MallocFailed () >from /home/enguser/libsqlite3.so.0 > #3 0xb7d4ae38 in ?? () >from /lib/tls/i686/cmov/libc.so.6 > #4 0x0963cf85 in ?? () > #5 0xb7fae418 in ??