sqlite3_errstr()
用英文描述错误代码,同时sqlite3_errmsg()
描述错误本身。
sqlite3
使用客户端(使用)的示例sqlite3_errmsg()
:
sqlite> CREATE TABLE IF NOT EXISTS articles(
...> id INTEGER PRIMARY KEY,
...> name_eng TEXT UNIQUE NOT NULL,
...> name_ger TEXT UNIQUE
...> );
sqlite> insert into articles values(1,'a','b');
sqlite> insert into articles values(1,'a','b');
Error: PRIMARY KEY must be unique
sqlite> insert into articles values(2,'a','b');
Error: column name_ger is not unique
sqlite> insert into articles values(2,'a','a');
Error: column name_eng is not unique
sqlite> insert into articles values(2,null,'b');
Error: articles.name_eng may not be NULL
sqlite> insert into articles values(2,'b','b');
Error: column name_ger is not unique