2016年6月1日 星期三

【Android】Sqlite 建資料表失敗


  • 問題:
  • Caused by: android.database.sqlite.SQLiteException: near "group": syntax error (code 1): , while compiling: DROP TABLE IF EXISTS group
  • 解決:
  • 參考:sqlite保留字
    The SQL standard specifies a huge number of keywords which may not be used as the names of tables, indices, columns, databases, user-defined functions, collations, virtual table modules, or any other named object.
在Android使用Sqlite做Content Provider,group table跟本沒建起來,所以在升級的時候也找不到table。因為用到的sqlite保留字,原來保留字不僅欄位不行,table名稱不行,自訂的function不行…反正就遇到就知道了 XD

沒有留言:

張貼留言