On 1/26/2011 7:48 PM, Bella Chan wrote:
> I got "19 constraint failed" error from this code:
>
> "CREATE TABLE functions ("
> " function_id integer PRIMARY KEY,"
> " function_name integer not null"
> ");\n"
>
>
> sqlite3_bind_int(statement,0,i);
> sqlite3_bind_int(statement,1,i+10);
Parameters are numbered from 1, not from 0. Your first sqlite3_bind_int
call fails; the second binds a value for function_id column; the
parameter for function_name retains its initial value of NULL. The
insert then runs afoul of NOT NULL constraint.
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users