android Sqlite给出错误"没有这样的列:dbdb(代码1):"

时间:2016-07-29 10:11:08

标签: android sqlite

我正在尝试在SQlite中插入我的所有edittext值,但它给了我错误。我是新的Sqlite,我尝试了很多来解决这个问题,但我失败了。我已经给出了我的sqlite代码和日志错误。

以下是我的Sqlite代码 -

db.execSQL("create table FieldTestDataFinal(CONS_ACCOUNT_NO numeric, MTR_SERIAL_NO numeric," +
" KNO_NO text,CONS_NAME text, CONS_ADDRESS1 text, CONS_ADDRESS2 text, CONS_ADDRESS3 text," +
 " TELEPHONE_NO text,CONS_MOBILE_NO text, SANCTION_LOAD text, " +
" TEST_TYPE text, COMPLAINT_NO text, CIRCLE text, DIVISION text, SUBDIVISION text," +
" TEST_NO text, ACCUCHEK_NO text, FATHER_NAME text, EXCEPTION_REMARK text, METER_MAKE text," +
                " METER_CONSTANT numeric, CURRENT_READING numeric, PHASE_TYPE text, METER_TYPE text," +
                " METER_STATUS text, METER_BOX_STATUS text, METER_TERMINAL_COVER text, METER_PUSH_FIT text," +
                " PUST_FIT text, METER_TERMINAL_BLOCK text, METER_DIGITAL_VISIBLE text, METER_FIGURES_UPSET text," +
                " METER_DIGITS_CHANGING text, SL_TYPE text, SL_ANYJOINT text, SL_TERMINATING_TOMTR text, " +
                " SL_SWITCHCUTOUT_BFRMTR text, SL_ARMOURED text, SL_COMMUNICATIONPORT text, SL_MTRLOCATION text," +
                " LI_EARTHLEAKAGEIND text, LI_REVERSELOADIND text, LI_BLINKINGOFLED text, SEAL_EXISTINGTERMCOVER text," +
                " SEAL_EXISTINGSTATUSMTRBOX text, SEAL_EXISTINGMTRBODY text, NEWSEALNO_MTRBOX text, NEWSEALNO_MTRBODY text," +
                " VERIFIED_BY text, POST text,CONS_REMARK text, OTHER_REMARK text, FAULTY_REMARK text, " +
                " TEMPER_REMARK text, CONS_REPRENAME text, CONTRACTOR_NAME text, SIGNATURE_CONSUMER text," +
                " METER_IMAGE1 text, METER_IMAGE2 text, METER_IMAGE3 text, METER_IMAGE4 text, METER_IMAGE5 text," +
                " CERTIFICATION_NO numeric, DUE_CALIBRATIONDATE text, THREEPHASE_RPHASE text, MTR_DISPLAY numeric," +
                " MTR_DISPLAYLOAD numeric, TESTER_NAME text, MTRPERTEST_R_PH text, MTRPERTEST_Y_PH text, MTRPERTEST_B_PH text," +
                " MTRPERTEST1_RUNNINGLOADVR text, MTRPERTEST1_RUNNINGLOADVY text, MTRPERTEST1_RUNNINGLOADVB text," +
                " MTRPERTEST1_RUNNINGLOADIR text, MTRPERTEST1_RUNNINGLOADIY text, MTRPERTEST1_RUNNINGLOADIB text," +
                " MTRPERTEST1_RUNNINGPF text, MTRPERTEST1_RUNNINGLOAD text, MTRPERTEST1_RUNNINGERRORPER text," +
                " MTRPERTEST1_RUNNINGPULSEREVCNT text, MTRPERTEST2_MAXLOADVR text, MTRPERTEST2_MAXLOADVY text, " +
                " MTRPERTEST2_MAXLOADVB text, MTRPERTEST2_MAXLOADIR text, MTRPERTEST2_MAXLOADIY text," +
                " MTRPERTEST2_MAXLOADIB text, MTRPERTEST2_MAXPF text, MTRPERTEST2_MAXLOAD text, MTRPERTEST2_MAXERRORPER text," +
                " MTRPERTEST2_MAXPULSEREVCNT text, VI_MTR_DISPLAYVR text, VI_MTR_DISPLAYVY text, VI_MTR_DISPLAYVB text," +
                " VI_MTR_DISPLAYIR text, VI_MTR_DISPLAYIY text, VI_MTR_DISPLAYIB text, VI_MTR_DISPLAYPF text," +
                " VI_MTR_DISPLAYLOAD text)");

        db.execSQL("Insert into FieldTestDataFinal (CONS_ACCOUNT_NO, MTR_SERIAL_NO, KNO_NO,CONS_NAME," +
                "CONS_ADDRESS1,CONS_ADDRESS2,CONS_ADDRESS3,TELEPHONE_NO, CONS_MOBILE_NO,SANCTION_LOAD," +
                "TEST_TYPE, COMPLAINT_NO, CIRCLE, DIVISION, SUBDIVISION, TEST_NO, ACCUCHEK_NO," +
                "FATHER_NAME, EXCEPTION_REMARK, METER_MAKE, METER_CONSTANT, CURRENT_READING," +
                "PHASE_TYPE, METER_TYPE, METER_STATUS, METER_BOX_STATUS, METER_TERMINAL_COVER, METER_PUSH_FIT," +
                "PUST_FIT, METER_TERMINAL_BLOCK, METER_DIGITAL_VISIBLE, METER_FIGURES_UPSET, METER_DIGITS_CHANGING," +
                "SL_TYPE, SL_ANYJOINT, SL_ARMOURED, SL_COMMUNICATIONPORT," +
                "SL_MTRLOCATION, LI_EARTHLEAKAGEIND, LI_REVERSELOADIND, LI_BLINKINGOFLED, SEAL_EXISTINGTERMCOVER," +
                "SEAL_EXISTINGSTATUSMTRBOX, SEAL_EXISTINGMTRBODY, NEWSEALNO_MTRBOX, NEWSEALNO_MTRBODY, VERIFIED_BY," +
                "POST, CONS_REMARK, OTHER_REMARK, FAULTY_REMARK, TEMPER_REMARK, CONS_REPRENAME, CONTRACTOR_NAME," +
                //"SIGNATURE_CONSUMER, METER_IMAGE1, METER_IMAGE2, METER_IMAGE3, METER_IMAGE4, METER_IMAGE5,
                "CERTIFICATION_NO, DUE_CALIBRATIONDATE, THREEPHASE_RPHASE, MTR_DISPLAY, MTR_DISPLAYLOAD, TESTER_NAME,MTRPERTEST_R_PH," +
                "MTRPERTEST_Y_PH, MTRPERTEST_B_PH, MTRPERTEST1_RUNNINGLOADVR, MTRPERTEST1_RUNNINGLOADVY,MTRPERTEST1_RUNNINGLOADVB," +
                "MTRPERTEST1_RUNNINGLOADIR, MTRPERTEST1_RUNNINGLOADIY, MTRPERTEST1_RUNNINGLOADIB, MTRPERTEST1_RUNNINGPF," +
                "MTRPERTEST1_RUNNINGLOAD, MTRPERTEST1_RUNNINGERRORPER, MTRPERTEST1_RUNNINGPULSEREVCNT,MTRPERTEST2_MAXLOADVR," +
                "MTRPERTEST2_MAXLOADVY, MTRPERTEST2_MAXLOADVB, MTRPERTEST2_MAXLOADIR, MTRPERTEST2_MAXLOADIY," +
                "MTRPERTEST2_MAXLOADIB, MTRPERTEST2_MAXPF, MTRPERTEST2_MAXLOAD, MTRPERTEST2_MAXERRORPER," +
                "MTRPERTEST2_MAXPULSEREVCNT, VI_MTR_DISPLAYVR, VI_MTR_DISPLAYVY, VI_MTR_DISPLAYVB, VI_MTR_DISPLAYIR," +
                "VI_MTR_DISPLAYIY, VI_MTR_DISPLAYIB, VI_MTR_DISPLAYPF, VI_MTR_DISPLAYLOAD) values(" + txtConsAcNo + "," +
                "" + txtMeterSrMo + ",'" + txtKNoNo + "','" + txtConsumerName + "','" + txtAddress1 + "','" + txtAddress2 + "'," +
                "'" + txtAddress3 + "','" + txtTelephoneNo + "','" + txtMobile + "','" + txtSancLoad + "','" + spnTestType + "'," +
                "'" + txtComplaintNo + "','" + spnCircle + "','" + spnDivision + "','" + spnSubDivision + "','" + txtTestNo + "'," +
                "'" + txtAccucheckNo + "','" + txtFatherName + "','" + txtExceptionremark + "','" + txtMeterMake + "'," +
                "" + txtMtrContaint + "," + txtCurrReading + ",'" + spnPhaseType + "','" + txtMeterType + "','" + spnMeterStatus
                + "','" + spnmtrBoxStatus + "'," +
                "'" + spnTerminalCover + "','" + spnMtrPushFit + "','" + spnPushFit + "','" + spnMtrTerminalBlock
                + "','" + spnMtrDigitalVisible + "'," +
                "'" + spnMtrFiguresupset + "','" + spnMtrDigitChange + "','" + spnSLType + "','" + spnAnyJoint + "','" + txtArmoured + "'," +
                "'" + spnCommunicationPort + "','" + spnMeterLocation + "','" + spnEarthLeackageIndi + "','" + spnRiverseLoadIndi + "'," +
                "'" + spnBlinkingLed + "','" + spnExistngTerminalCvr + "','" + spnExistingSealMrBox + "','" + txtNewSealNoMtrBox
                + "','" + txtExistSealMtrBody + "'," +
                "'" + spnNewSealMtrBdySeal + "','" + txtVerifiedBy + "','" + txtPost + "','" + txtConsumerRemark + "'," +
                "'" + txtOtherRemark + "','" + txtFacultyremark + "','" + txtTemperRemark + "','" + txtConsumerRepRename + "'," +
                "'" + txtContractorName + "'," + txtCertifivationNo + ",'" + txtDueCalibrationDate + "','" + txt3PhaseRPhase + "'," +
                "" + txtMeterDisplay + ",'" + txtMeterDisplayLoad + "','" + txtTesterName + "','" + txtRPH + "','" + txtYPH + "','" + txtBPH + "',"
                +
                "'" + txtRLVR + "','" + txtDisplayVY + "','" + txtRLVB + "'," + txtRLIR + ",'" + txtRLIY + "','" + txtRLIB + "'," +
                "'" + txtRLPF + "','" + txtRLRL + "','" + txtTestRL + "','" + txtTest1RLPulsecnt + "','" + txt2RLVR + "'," +
                "'" + txt2RLVY + "','" + txt2RLVB + "','" + txt2RLIR + "','" + txt2RLIY + "','" + txt2RLIB + "','" + txt2RLPF + "'," +
                "'" + txt2RLRL + "','" + txt2TestRL + "','" + txt2testRlPulsent + "','" + txtDisplayVR1 + "','" + txtDisplayVY1 + "'," +
                "'" + txtDisplayVB1 + "','" + txtDisplayIR + "','" + txtDisplayIY + "','" + txtDisplayIB + "','" + txtDisplayPF1 + "'," +
                "'" + txtDisplayLoad1 + "')");

以下是我的日志错误 -

FATAL EXCEPTION: main
                                                                                    Process: code.meter.securemeter.com.securemeter, PID: 28674
                                                                                    android.database.sqlite.SQLiteException: no such column: dbdb (code 1): , while compiling: Insert into FieldTestDataFinal (CONS_ACCOUNT_NO, MTR_SERIAL_NO, KNO_NO,CONS_NAME,CONS_ADDRESS1,CONS_ADDRESS2,CONS_ADDRESS3,TELEPHONE_NO, CONS_MOBILE_NO,SANCTION_LOAD,TEST_TYPE, COMPLAINT_NO, CIRCLE, DIVISION, SUBDIVISION, TEST_NO, ACCUCHEK_NO,FATHER_NAME, EXCEPTION_REMARK, METER_MAKE, METER_CONSTANT, CURRENT_READING,PHASE_TYPE, METER_TYPE, METER_STATUS, METER_BOX_STATUS, METER_TERMINAL_COVER, METER_PUSH_FIT,PUST_FIT, METER_TERMINAL_BLOCK, METER_DIGITAL_VISIBLE, METER_FIGURES_UPSET, METER_DIGITS_CHANGING,SL_TYPE, SL_ANYJOINT, SL_ARMOURED, SL_COMMUNICATIONPORT,SL_MTRLOCATION, LI_EARTHLEAKAGEIND, LI_REVERSELOADIND, LI_BLINKINGOFLED, SEAL_EXISTINGTERMCOVER,SEAL_EXISTINGSTATUSMTRBOX, SEAL_EXISTINGMTRBODY, NEWSEALNO_MTRBOX, NEWSEALNO_MTRBODY, VERIFIED_BY,POST, CONS_REMARK, OTHER_REMARK, FAULTY_REMARK, TEMPER_REMARK, CONS_REPRENAME, CONTRACTOR_NAME,CERTIFICATION_NO, DUE_CALIBRATIONDATE, THREEPHASE_RPHASE, MTR_DISPLAY, MTR_DISPLAYLOAD, TESTER_NAME,MTRPERTEST_R_PH,MTRPERTEST_Y_PH, MTRPERTEST_B_PH, MTRPERTEST1_RUNNINGLOADVR, MTRPERTEST1_RUNNINGLOADVY,MTRPERTEST1_RUNNINGLOADVB,MTRPERTEST1_RUNNINGLOADIR, MTRPERTEST1_RUNNINGLOADIY, MTRPERTEST1_RUNNINGLOADIB, MTRPERTEST1_RUNNINGPF,MTRPERTEST1_RUNNINGLOAD, MTRPERTEST1_RUNNINGERRORPER, MTRPERTEST1_RUNNINGPULSEREVCNT,MTRPERTEST2_MAXLOADVR,MTRPERTEST2_MAXLOADVY, MTRPERTEST2_MAXLOADVB, MTRPERTEST2_MAXLOADIR, MTRPERTEST2_MAXLOADIY,MTRPERTEST2_MAXLOADIB, MTRPERTEST2_MAXPF, MTRPERTEST2_MAXLOAD, MTRPERTEST2_MAXERRORPER,MTRPERTEST2_MAXPULSEREVCNT, VI_MTR_DISPLAYVR, VI_MTR_DISPLAYVY, VI_MTR_DISPLAYVB, VI_MTR_DISPLAYIR,VI_MTR_DISPLAYIY, VI_MTR_DISPLAYIB, VI_MTR_DISPLAYPF, VI_MTR_DISPLAYLOAD) values(40131332582,359552,'0','SH. MAN MOHAN LAKHERA','S/O G.M.LAKHERA 1/12 INDRA COLONY',' zbd',' zvvs',' 8454','7469874579','10 KW','None','595','1','2','3','88454','8979','zbzb','xbbd','GENUS',5949,5994,'1-Phase','ELECTRONIC','None','None','None','None','Found Locked','None','None','None','None','None','None','dvsv','None','None','None','Yes','None','Ok','Ok','dbdbsb','dgdhdh','Ok','xbsbvs','xvdvsg','fdh','dbdbd','dbdb','zgsg','xgdg','dhdh',8848494,'xsgsgd','zvsgsg',94949,'89799','dhd','fbd','djs','dbdb','xbdb','android.support.v7.widget.AppCompatEditText{21395ff VFED..CL ........ 0,208-340,292 #7f0c0093 app:id/txtDisplayVY}','dbe',dbdb,'fbdb','zbb','dbsb','bsb','dbsbs','dnd','fis','sjd','cbc','','cjc','djdj','dgdj','fvf','fjrj','cb','dhei','fgud','xbjw','nsj','sva','cnxbd','eyb d','en x')
                                                                                    #################################################################

2 个答案:

答案 0 :(得分:2)

您忘记在其中一个字符串值周围添加单引号:dbdb应为'dbdb'

尽管:首选使用?变量并绑定值。

答案 1 :(得分:0)

我不确定你在那里尝试了什么,但我认为你错过了dbdb的''