Re: [sqlite] binding an IN

2010-07-12 Thread Richard Hipp
Have you looked at the "test_intarray" code. http://www.sqlite.org/src/artifact/489edb9068bb926583445cb02589344961054207 On Sun, Jul 11, 2010 at 9:42 PM, Sam Carleton wrote: > Is there any way to bind to this query? > > SELECT * FROM table WHERE tableId IN ( ? ); > > Where ? should be 1,2,3,4 >

Re: [sqlite] binding an IN

2010-07-12 Thread Igor Sereda
We have a similar task and we solve it by using a statement with lots of parameters SELECT * FROM table WHERE tableId IN (?, ?, ?, ?, ) The number of "?", let's call it N, is fixed, and set to ~100 -- tuned by measuring performance. When the actual number of parameters is less th

Re: [sqlite] binding an IN

2010-07-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/11/2010 10:36 PM, zeal wrote: > how about (tableId=? or tableId=? or tableId=? or tableId=?) > just convert IN to or. Jay already mentioned that approach. The downside is you have to know how big the list is in advance and construct SQL text wi

Re: [sqlite] binding an IN

2010-07-11 Thread zeal
how about (tableId=? or tableId=? or tableId=? or tableId=?) just convert IN to or. -- From: "Roger Binns" Sent: Monday, July 12, 2010 11:00 AM To: "General Discussion of SQLite Database" Subject: Re: [sqlite] binding an

Re: [sqlite] binding an IN

2010-07-11 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/11/2010 06:42 PM, Sam Carleton wrote: > Is there any way to bind to this query? > > SELECT * FROM table WHERE tableId IN ( ? ); > > Where ? should be 1,2,3,4 There is no C api that allows for binding a list so you'll have to pick an alternativ

Re: [sqlite] binding an IN

2010-07-11 Thread Simon Slavin
On 12 Jul 2010, at 2:42am, Sam Carleton wrote: > Is there any way to bind to this query? > > SELECT * FROM table WHERE tableId IN ( ? ); > > Where ? should be 1,2,3,4 I think the simplest way to do that would be to use GLOB. Not very elegant but it should work. http://www.sqlite.org/lang_ex

Re: [sqlite] binding an IN

2010-07-11 Thread Jay A. Kreibich
On Sun, Jul 11, 2010 at 09:42:41PM -0400, Sam Carleton scratched on the wall: > Is there any way to bind to this query? > > SELECT * FROM table WHERE tableId IN ( ? ); > > Where ? should be 1,2,3,4 You can do IN ( ?, ?, ?, ? ), but I'm guessing that's not the answer you're looking for. Th

[sqlite] binding an IN

2010-07-11 Thread Sam Carleton
Is there any way to bind to this query? SELECT * FROM table WHERE tableId IN ( ? ); Where ? should be 1,2,3,4 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users