Android SQLiteConstraintException: error code 19: constraint failed

悲剧的问题竟然是这样产生的。

// 创建通话记录表, 用户id,通话对象id, String callTable = "CREATE TABLE IF NOT EXISTS '%s'" + "(userid VARCHAR, callwith VARCHAR, calltype VARCHAR, callstart time, callend time, callmedia VARCHAR" + ");";

// 创建通话记录表, 用户id,通话对象id, String callTable = "CREATE TABLE IF NOT EXISTS '%s'" + "(userid VARCHAR not Null , callwith VARCHAR not null, calltype VARCHAR, callstart time, callend time, callmedia VARCHAR" + ");";

那么插入的时候讲会出现如上错误

posted @ 2011-05-20 17:40  pandans  阅读(5599)  评论(3编辑  收藏  举报