Re: [sqlite] Patch: sqlite3_query_string

2007-02-16 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wesley W. Terpstra wrote: > Please consider applying the attached patch to SQLite3. It adds support > for a method sqlite3_query_string(sqlite3_stmt*); I'd greatly appreciate this method being present as well. In order to implement statement caching

Re: [sqlite] [patch] cleanup cross-compiling logic

2007-02-16 Thread Joe Wilson
The sqlite autoconf stuff has been neglected for a while... http://marc.10east.com/?l=sqlite-users=116760371614235=2 Consider making a ticket for this issue and mentioning it in this autoconf meta ticket: http://www.sqlite.org/cvstrac/tktview?tn=2133 --- Mike Frysinger <[EMAIL PROTECTED]>

[sqlite] [patch] cleanup cross-compiling logic

2007-02-16 Thread Mike Frysinger
for some reason the current configure script tries to implement its own cross-compiling logic which ends up being pretty fragile ... the attached patch punts pretty much all of it in favor of the standard method that just about every other autoconf-based project uses there is one more small

[sqlite] [patch] cleanup readline checks

2007-02-16 Thread Mike Frysinger
the readline is a bit inflexible ... you cant explicitly disable it and the search logic is broken for cross-compiling ... attached patch should fix things up -mike pgpSmsCuuJdPV.pgp Description: PGP signature Index: configure.ac

RE: [sqlite] SQL query - TOP

2007-02-16 Thread Allan, Mark
Thanks Donald Griggs and Igor Tandetnik, I have indeed 'taken it to the limit' and it works ok, and I can't believe how quick it works. Thanks > -Original Message- > From: Griggs, Donald [mailto:[EMAIL PROTECTED] > Sent: 16 February 2007 17:49 > To: sqlite-users@sqlite.org > Subject:

Re: [sqlite] Update and insert questions

2007-02-16 Thread P Kishor
On 2/16/07, Jim Crafton <[EMAIL PROTECTED]> wrote: > but it fails because the embedded WHERE clause is no longer catching > the row. It is still looking for > > WHERE LastName='Doe' AND > FirstName='John' AND > Address='100 Nowhere Ave.' AND > Age=45; > > instead of > > WHERE

RE: [sqlite] Re: SQL query - TOP

2007-02-16 Thread Samuel R. Neff
I for one would love to see SQLite support TOP as well as LIMIT (internally it can just translate TOP to LIMIT). It would greatly help in situations where we want to support multiple database engines in an application. Shouldn't be a huge addition to the size of the engine either... :-)

RE: [sqlite] SQL query - TOP

2007-02-16 Thread Griggs, Donald
Regarding: "It would appear that the "TOP" syntax is not supported by SQLite (maybe just a Microsoft thing?). However is there an alternative? " Take it to the "LIMIT", Mark. See: http://sqlite.org/lang_select.html The LIMIT clause places an upper bound on the number of rows returned in

[sqlite] Re: SQL query - TOP

2007-02-16 Thread Igor Tandetnik
Allan, Mark wrote: Select Top * From PATIENTS WHERE PATIENT_PK NOT IN (SELECT TOP PATIENT_PK From PATIENTS Order By PATIENT_PK) Order By PATIENT_PK It would appear that the "TOP" syntax is not supported by SQLite (maybe just a Microsoft thing?). SQLite supports LIMIT and OFFSET clauses. To

[sqlite] SQL query - TOP

2007-02-16 Thread Allan, Mark
Hi, I have an SQL question. The following syntax is used in a MSDN example for retrieving a certain range of records from a table, so that data can be loaded into a DataGridView as a when is is needed for performance reasons:- Select Top * From PATIENTS WHERE PATIENT_PK NOT IN (SELECT TOP

Re: [sqlite] Update and insert questions

2007-02-16 Thread drh
"Jim Crafton" <[EMAIL PROTECTED]> wrote: > So I guess the moral of this is to use bind cautiously :) > Bind is usually considered the safer way of doing things since it make SQL injection attachs much less likely. -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
but it fails because the embedded WHERE clause is no longer catching the row. It is still looking for WHERE LastName='Doe' AND FirstName='John' AND Address='100 Nowhere Ave.' AND Age=45; instead of WHERE LastName='Doe' AND FirstName='Jane' AND Address='100 Nowhere Ave.' AND Age=45;

Re: [sqlite] Update and insert questions

2007-02-16 Thread Dennis Cote
Jim Crafton wrote: well, the first time you update the row (and, you haven't said what values you update it with), it succeeds because your WHERE clause successfully matches. I'm using the sqlite3_bind functions to modify the values. Second time, the WHERE clause doesn't match because you

Re: [sqlite] Update and insert questions

2007-02-16 Thread Dennis Cote
Jim Crafton wrote: I thought that the plain "?" character was an indicator that you were going to modify the column value via the sqlite3_bindXXX functions. You are correct. These parameters should not be quoted. Dennis Cote

Re: [sqlite] Update and insert questions

2007-02-16 Thread P Kishor
I guess I wasn't clear (either that, or I am not understanding what you are doing). Let's try again (and, it doesn't matter that you are using sqlite3_bind; I am just talking workflow here). You have the following row -- Doe John 100 Nowhere Ave.

RE: [sqlite] Update and insert questions

2007-02-16 Thread RB Smissaert
I did say I was nearly new to SQLite. RBS -Original Message- From: Jim Crafton [mailto:[EMAIL PROTECTED] Sent: 16 February 2007 16:28 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Update and insert questions On 2/16/07, RB Smissaert <[EMAIL PROTECTED]> wrote: > Nearly new to SQLite

Re: [sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
well, the first time you update the row (and, you haven't said what values you update it with), it succeeds because your WHERE clause successfully matches. I'm using the sqlite3_bind functions to modify the values. Second time, the WHERE clause doesn't match because you have changed the

Re: [sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
On 2/16/07, RB Smissaert <[EMAIL PROTECTED]> wrote: Nearly new to SQLite as well, but shouldn't this: UPDATE Person SET LastName=?, FirstName=?, Address=?, Age=? Be altered to this: UPDATE Person SET LastName='?', FirstName='?', Address='?', Age='?' I thought that the plain "?" character

Re: [sqlite] Update and insert questions

2007-02-16 Thread P Kishor
On 2/16/07, Jim Crafton <[EMAIL PROTECTED]> wrote: OK, please bear with me here, as I'm very much of an SQL newbie. I'm writing a wrapper around sqlite. I want the to code to be able to modify a given value (column) of a specific row. To do this, as I understand it, I need to use the SQL UPDATE

[sqlite] Update and insert questions

2007-02-16 Thread Jim Crafton
OK, please bear with me here, as I'm very much of an SQL newbie. I'm writing a wrapper around sqlite. I want the to code to be able to modify a given value (column) of a specific row. To do this, as I understand it, I need to use the SQL UPDATE statement coupled with a WHERE clause. So assuming

Re: [sqlite] OR in virtual tables

2007-02-16 Thread Jos van den Oever
2007/2/16, Dan Kennedy <[EMAIL PROTECTED]>: I think with a virtual table all you can do is: SELECT * FROM vtable WHERE x = 'a' UNION SELECT * FROM vtable WHERE x = 'b' Virtual tables cannot supply an index for WHERE clauses of the form "x IN ('a', 'b')" or "x = 'a' OR x = 'b'" the way

Re: [sqlite] OR in virtual tables

2007-02-16 Thread Dan Kennedy
I think with a virtual table all you can do is: SELECT * FROM vtable WHERE x = 'a' UNION SELECT * FROM vtable WHERE x = 'b' Virtual tables cannot supply an index for WHERE clauses of the form "x IN ('a', 'b')" or "x = 'a' OR x = 'b'" the way normal tables can. Dan. On Fri, 2007-02-16 at