Yes i am calling sqlite3_prepare_v2....

 snprintf(command, 512, INSERT_DN);
        if ( (rv = sqlite3_prepare_v2(sqlHandle->db, command, -1,
                                     &newStmt, NULL) ) != SQLITE_OK )
        {
           fprintf(stderr, "Error Insert : sqlite3_prepare_v2, Error code :
%d\n", rv);
           sqlite3_finalize(newStmt);
           return rv;
        }
        rv = sqlite3_bind_blob(newStmt, 1, aInBuffer.ptr, aInBuffer.size,
SQLITE_STATIC);
        if (rv != SQLITE_OK)
        {
            fprintf(stderr, "Error Insert : sqlite3_bind_blob, Error code :
%d\n", rv);
            sqlite3_finalize(newStmt);
            return rv;
        }
        rv = sqlite3_bind_int(newStmt, 2 , aInClassId);
        if (rv != SQLITE_OK)
        {
            fprintf(stderr, "Error Insert : sqlite3_bind_int, Error code :
%d\n", rv);
            sqlite3_finalize(newStmt);
            return rv;
        }


On Wed, Apr 6, 2016 at 4:55 PM, Simon Davies <simon.james.davies at gmail.com>
wrote:

> On 6 April 2016 at 12:16, Kumar Suraj <surajnitk at gmail.com> wrote:
> > Hi
> .
> .
> .
> > Here is table definition and insert statement which is causing this
> >
> > #define CREATE_TABLE_DNINDEX "CREATE TABLE IF NOT EXISTS TBL (dn BLOB,
> > pclassid INTEGER, pkey INTEGER, kindex INTEGER PRIMARY KEY ASC)"
> >
> > #define INSERT_DN "INSERT INTO TBL (dn,pclassid,pkey) VALUES (?,?,?);"
> >
> >  rv = sqlite3_bind_int(newStmt, 2 , aInClassId);
> >
> >         if (rv != SQLITE_OK)
> >
> >         {
> >
> >             fprintf(stderr, "Error Insert : sqlite3_bind_int, Error code
> :
> > %d\n", rv);
> >
> >             sqlite3_finalize(newStmt);
> >
> >             return rv;
> >
> >         }
>
> Are you calling sqlite3_prepare_v2 before your call to sqlite3_bind_int?
>
> Regards,
> Simon
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to