Re: [sqlite] Problem with binding parameters to LIKE

2011-10-24 Thread Navaneeth.K.N
On Sun, Oct 23, 2011 at 2:21 PM, Baruch Burstein wrote: > I have done something similar and it worked for me, but there is an issue > with indexes you should take into account, as discussed here: >

Re: [sqlite] Problem with binding parameters to LIKE

2011-10-23 Thread Igor Tandetnik
Navaneeth.K.N wrote: > I am trying to use parameters in a LIKE query. I have the following > code which uses Sqlite C/C++ API. > > const char *sql = "SELECT word FROM words WHERE word LIKE ?1 || '%' > ORDER BY freq DESC LIMIT 10;"; > > int rc = sqlite3_prepare_v2 (db,

Re: [sqlite] Problem with binding parameters to LIKE

2011-10-23 Thread Richard Hipp
On Sat, Oct 22, 2011 at 11:53 PM, Navaneeth.K.N wrote: > I hooked up sqlite3_trace and > sqlite3_profile and printed the SQL being executed. Unfortunatly, > these routines won't give the SQL with values bound to it. > sqlite3_trace() does, since version 3.6.21

Re: [sqlite] Problem with binding parameters to LIKE

2011-10-23 Thread Baruch Burstein
I have done something similar and it worked for me, but there is an issue with indexes you should take into account, as discussed here: http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2011-July/031470.html . Out of curiosity (since this query and it's field names seem very similar to

[sqlite] Problem with binding parameters to LIKE

2011-10-22 Thread Navaneeth.K.N
Hello, I am trying to use parameters in a LIKE query. I have the following code which uses Sqlite C/C++ API. const char *sql = "SELECT word FROM words WHERE word LIKE ?1 || '%' ORDER BY freq DESC LIMIT 10;"; int rc = sqlite3_prepare_v2 (db, sql, -1, , NULL); if ( rc != SQLITE_OK ) return