Martin: Thanks for the imput. In fact, afther some years using SQLite I'v spent almos a weekend because don't remember that the index in the sqlite_column_xxx(sqlite3_stmt*, iCol ) where I read the data from the source table, "the leftmost column of the result set has the index 0", and in the bind sentence, "The leftmost SQL parameter has an index of 1" -I do both in the same loop-.
Any way, the question remains, and the method proposed by Owen perhaps is good for debug, but not as a standard method. A.J. Millan ----- Original Message ----- From: "Martin Engelschalk" <engelsch...@codeswift.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Monday, November 16, 2009 10:52 AM Subject: Re: [sqlite] Fine-grainy error report needed > Hi, > > First, the index of the bind variable (second parameter to > sqlite3_bind_xxxx, your 'i') must begin with 1, and not 0, see > http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob > > Sqlite does not use strong typing, which means that you can put any data > into any column. > However INTERGER PRIMARY KEY is an exception and must be an integer. > Therefore, the error most probably comes from your 'Id' - column. > > Martin > > A.J.Millan wrote: >> Hi list: >> >> Supposing a dBase without constraints (some like this but not limited to >> it): >> >> CREATE TABLE tbl (Id INTEGER PRIMARY KEY, Nm INTEGER, Cl INTEGER, Dc >> REAL, >> Dm REAL, St INTEGER); >> >> A query to poblate: >> >> "INSERT INTO tbl (id,nm,cl,dc,dm,st) VALUES (?,?,?,?,?,?)" >> >> Then six binds (i = 0 to 5): >> >> sqlite3_bind_xxx (pStmt, i, ...); >> >> and a "step": resp = sqlite3_step(pStmt);. >> >> Then, if resp == SQLITE_MISMATCH (Data type mismatch) >> >> Do is there some way to know the index (i) of the offending bind? >> >> By the way: I'm trying to make a general function to import (duplicate) >> data >> from an attached table. >> >> Thanks in advance. >> >> A.J.Millan >> >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users