[sqlite] error during sqlite_bind

2015-04-07 Thread Kumar Suraj
Hi I am trying to use SQLite c api to create a db, table and then do a select query but i am getting following error #define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ Here is the code call #define SELECT_DN "select kindex from TBL where dn=?" char buffer[100] = "a/b/c/d

[sqlite] error during sqlite_bind

2015-04-07 Thread Igor Tandetnik
On 4/7/2015 8:04 PM, Kumar Suraj wrote: > if ( (rv = sqlite3_prepare_v2(sqlHandle->db, command, strlen(command), > &newStmt, NULL) ) != SQLITE_OK ) command: undeclared identifier. -- Igor Tandetnik

[sqlite] error during sqlite_bind

2015-04-07 Thread Kumar Suraj
I have not added the whole code.. command is defined.. in my code.. On Tue, Apr 7, 2015 at 5:42 PM, Igor Tandetnik wrote: > On 4/7/2015 8:04 PM, Kumar Suraj wrote: > >> if ( (rv = sqlite3_prepare_v2(sqlHandle->db, command, strlen(command), >> &newStmt, NULL)

[sqlite] error during sqlite_bind

2015-04-07 Thread Kumar Suraj
You can add this to top of the code.. char command[512]; snprintf(command, 512, SELECT_DN); On Tue, Apr 7, 2015 at 6:11 PM, Kumar Suraj wrote: > I have not added the whole code.. command is defined.. in my code.. > > On Tue, Apr 7, 2015 at 5:42 PM, Igor Tandetnik wrote: > >> On 4/7/201

[sqlite] error during sqlite_bind

2015-04-07 Thread Igor Tandetnik
On 4/7/2015 9:11 PM, Kumar Suraj wrote: > You can add this to top of the code.. > > char command[512]; > snprintf(command, 512, SELECT_DN); I don't see anything wrong in the code you've shown. The problem must lie in the code you haven't. My guess would be, the query you are preparing i

[sqlite] error during sqlite_bind

2015-04-07 Thread Richard Hipp
On 4/7/15, Igor Tandetnik wrote: > On 4/7/2015 9:11 PM, Kumar Suraj wrote: >> You can add this to top of the code.. >> >> char command[512]; >> snprintf(command, 512, SELECT_DN); > > I don't see anything wrong in the code you've shown. The problem must > lie in the code you haven't. My gu

[sqlite] error during sqlite_bind

2015-04-09 Thread Kumar Suraj
I tried suggested and see the correct query.. so i am not sure whats going wrong.. any insight.. query is select kindex from TBL where dn=? select kindex from TBL where dn=? debug information string a/b/c/d size 8 Error Insert : sqlite3_bind_blob, Error code : 25 snprintf(command, 512, SELECT_DN