Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android SQLite中没有这样的列_Android_Sql_Sqlite_Android Sqlite - Fatal编程技术网

Android SQLite中没有这样的列

Android SQLite中没有这样的列,android,sql,sqlite,android-sqlite,Android,Sql,Sqlite,Android Sqlite,好吧,我尽我所能尝试了,我在这里看到了所有关于这个错误的帖子,没有一个解决了我的问题: 这是我的简单update语句,我想在某个characterName处将每个itemSlotIndex递增1 String myQuery = "UPDATE " + theTable.getTableName() + " SET " + theTable.getItemSlotIndex() + " = " + theTable.getItemSlotIndex() + " + 1 WHER

好吧,我尽我所能尝试了,我在这里看到了所有关于这个错误的帖子,没有一个解决了我的问题:

这是我的简单update语句,我想在某个characterName处将每个itemSlotIndex递增1

String myQuery = "UPDATE " + theTable.getTableName() + " SET " + theTable.getItemSlotIndex()

        + " = " + theTable.getItemSlotIndex() + " + 1 WHERE " + theTable.getCharName() + " = "+character.getName();

        Log.i("myQuery", myQuery);

        theDatabase.execSQL(myQuery);
如果这种混乱可能会产生误导,下面是我对SQL语句的logcat输出:

UPDATE CharsTable SET slot_index = slot_index + 1 WHERE char_name = Francis
如你所见

这是我的桌子

slot_index是属性,我想递增

克劳斯在哪里:我只想更新char_name等于“Francis”的行

错误就在于哇:

02-06 19:01:13.472: E/SQLiteLog(16743): (1) no such column: Francis
没有这样的专栏

我在添加where子句参数时没有遇到这样的列错误

你知道我做错了什么吗?

你已经忘记了弗朗西斯身边的那句话:

UPDATE CharsTable SET slot_index = slot_index + 1 WHERE char_name = 'Francis'

... + " = '"+character.getName() + "'";
你忘记了弗朗西斯身边的'':

UPDATE CharsTable SET slot_index = slot_index + 1 WHERE char_name = 'Francis'

... + " = '"+character.getName() + "'";

在字符串值周围加引号?

在字符串值周围加引号?

这与上面Rida发布的答案完全相同,我只是没有那么详细。仅仅因为有一个问号并不意味着我在问一个问题。这和上面Rida发布的答案完全相同,我只是没有那么详细。仅仅因为有一个问号并不意味着我在问一个问题。