What I usually do is work my way through binding each value to null one
at a time until it works, when it does I know I've found the column that
was previously the offending one.

- and when I say null I should really say "some known value that is
within the constraints range on the column".

-Since you're in a 'error' condition and likely to abort processing then
the fact that this is comparatively slow compared to doing them all at
once really doesn't matter.

Owen.



-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of A.J.Millan
Sent: Monday, November 16, 2009 9:41 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Fine-grainy error report needed

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

Reply via email to