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";
    char * testdn = buffer;
    lBuffer.size = 100;
    lBuffer.ptr = testdn;

if ( (rv = sqlite3_prepare_v2(sqlHandle->db, command, strlen(command),
                                     &newStmt, NULL) ) != SQLITE_OK )
        {
           fprintf(stderr, "Error Insert : sqlite3_prepare_v2, Error code :
%d\n", rv);
           return;
        }
        rv = sqlite3_bind_blob(newStmt, 1, lBuffer.ptr, lBuffer.size,
SQLITE_STATIC);
        if (rv != SQLITE_OK)
        {
            fprintf(stderr, "Error Insert : sqlite3_bind_blob, Error code :
%d\n", rv);
            return;
        }

Reply via email to