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);
// todo remove this printf call
fprintf(stderr, "query is %s\n", command);
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;
}
// todo remove the 2 lines
const char *savedcopy = sqlite3_sql(newStmt);
fprintf(stderr, "%s\n", savedcopy);
fprintf(stderr, "debug information string %s size %lu\n",
aInBuffer.ptr, sizeof(aInBuffer.ptr));
rv = sqlite3_bind_blob(newStmt, 1, aInBuffer.ptr,
sizeof(aInBuffer.ptr), SQLITE_STATIC);
On Tue, Apr 7, 2015 at 6:40 PM, Richard Hipp <drh at sqlite.org> wrote:
> On 4/7/15, Igor Tandetnik <igor at tandetnik.org> 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 guess would be, the query you are
> > preparing is not the query you think you are preparing. Print "command"
> > and strlen(command) right before sqlite3_prepare_v2 call, to
> double-check.
>
> Or, print the result of sqlite3_sql(newStmt) right after
> sqlite3_prepare_v2() returns successfully.
> --
> D. Richard Hipp
> drh at sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>