我正在做一个虚拟的安卓项目来掌握一些东西。以下代码行在没有任何错误的情况下破坏了我的android应用程序。我使用Idea作为IDE。
database.execSQL("Insert Into todos(uid, name, created_on, changed_on) values( 6a7047ed-c2f9-407f-a774-1c02b0fe9caf , todo , DATETIME( NOW ), DATETIME( NOW ))");
我确信数据库有给定的列,如果我只是使用:
database.execSQL("Insert Into todos(uid, name) values( 6a7047ed-c2f9-407f-a774-1c02b0fe9caf , todo )");
应用程序以应有的方式工作。
我试图插入这样的日期(基于与此事相关的已回答问题):
2012-05-25 16:52:00
或
date( now )
I get the same crash with no err或 或 debug log.
我在这里错过了什么?
已更新
根据请求,用于创建数据库表的代码。
public static final String TABLE_TODOS = "todos";
public static final String COLUMN_ID = "id";
public static final String COLUMN_UID = "uid";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_CHECKED = "checked";
public static final String COLUMN_TO_DELETE = "must_delete";
public static final String COLUMN_CHANGED_ON = "changed_on";
public static final String COLUMN_CREATED = "created_on";
private static final String DATABASE_CREATE = "create table "
+ TABLE_TODOS + "( "
+ COLUMN_ID + " integer primary key autoincrement, "
+ COLUMN_UID + " varchar(50), "
+ COLUMN_NAME + " text not null, "
+ COLUMN_CHECKED + " integer default 0, "
+ COLUMN_TO_DELETE + " integer default 0, "
+ COLUMN_CHANGED_ON + " datetime "
+ COLUMN_CREATED + " datetime "
+");";