• android.database.sqlite.SQLiteException: table TB_READ_PERIOD already exists


    11-13 16:04:04.209: ERROR/AndroidRuntime(19827): FATAL EXCEPTION: main
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827): java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.peter.gasread/cn.peter.gasread.DBTestActivity}: android.database.sqlite.SQLiteException: table TB_READ_PERIOD already exists: , while compiling: CREATE TABLE TB_READ_PERIOD(_id INTEGER PRIMARY KEY,READ_BOOK_ID TEXT,READ_BOOK_NAME TEXT,READER_ID TEXT,READER_NAME TEXT,STATION_ID TEXT,STATION_NAME TEXT,HOUSE_ADDRESS TEXT,READ_SEQ INTEGER,LAST_NUMBER INTEGER,LAST_GAS_QTY INTEGER,LAST_DATE INTEGER,READ_PERIOD TEXT,GAS_METER_ID TEXT,REGISTRY_ID TEXT,FULL_SCALE REAL,PRICE REAL,READ_DATA_TYPE TEXT,PLATE_NUMBER TEXT,OWN_AMOUNT REAL,AVG_GAS_QTY REAL,HIGH_FACTOR REAL,LOW_FACTOR REAL)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.ActivityThread.access$600(ActivityThread.java:128)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.os.Handler.dispatchMessage(Handler.java:99)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.os.Looper.loop(Looper.java:137)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.ActivityThread.main(ActivityThread.java:4517)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at java.lang.reflect.Method.invokeNative(Native Method)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at java.lang.reflect.Method.invoke(Method.java:511)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at dalvik.system.NativeStart.main(Native Method)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827): Caused by: android.database.sqlite.SQLiteException: table TB_READ_PERIOD already exists: , while compiling: CREATE TABLE TB_READ_PERIOD(_id INTEGER PRIMARY KEY,READ_BOOK_ID TEXT,READ_BOOK_NAME TEXT,READER_ID TEXT,READER_NAME TEXT,STATION_ID TEXT,STATION_NAME TEXT,HOUSE_ADDRESS TEXT,READ_SEQ INTEGER,LAST_NUMBER INTEGER,LAST_GAS_QTY INTEGER,LAST_DATE INTEGER,READ_PERIOD TEXT,GAS_METER_ID TEXT,REGISTRY_ID TEXT,FULL_SCALE REAL,PRICE REAL,READ_DATA_TYPE TEXT,PLATE_NUMBER TEXT,OWN_AMOUNT REAL,AVG_GAS_QTY REAL,HIGH_FACTOR REAL,LOW_FACTOR REAL)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:68)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:134)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:361)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteStatement.acquireAndLock(SQLiteStatement.java:260)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:84)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:2021)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1961)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at cn.peter.gasread.db.DBGasRead$DatabaseHelper.onCreate(DBGasRead.java:170)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:165)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at cn.peter.gasread.db.DBGasRead.<init>(DBGasRead.java:199)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at cn.peter.gasread.DBTestActivity.onCreate(DBTestActivity.java:25)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.Activity.performCreate(Activity.java:4470)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
    11-13 16:04:04.209: ERROR/AndroidRuntime(19827):     ... 11 more

    跟踪显示:几个表的表名重复了!

  • 相关阅读:
    《A First Course in Probability》-chaper5-连续型随机变量-随机变量函数的期望
    Codeforces 837F
    Codeforces #428 Div2 D
    poj3233(等比矩阵求和)
    Codeforces #427 Div2 D
    Codeforces 837E
    hdu6086(AC 自动机)
    hdu2825(AC 自动机)
    poj2778(AC 自动机)
    Codeforces #426 Div2 D(线段树优化 DP )
  • 原文地址:https://www.cnblogs.com/fengzhblog/p/2768205.html
Copyright © 2020-2023  润新知