Home > Mobile >  Sqlite3 in android studio to insert data error
Sqlite3 in android studio to insert data error

Time:10-10

I want to create a table called mobiletable, and constantly add data to the table, but always adds the failure and the error :
Android. Database. Sqlite. SQLiteException: no to the table: recording_table: (code 1), while the compiling: INSERT INTO recording_table (Times, All_Memory THIS_CPU, THIS_Memory, ALL_CPU, Name) VALUES (?,?,?,?,? ,? ,? ,? ,? ,?)

Here is my code:





Turn to for help! ~

CodePudding user response:

I can't see you have created this table recording_table?

CodePudding user response:

1, you commented sqliteDb execSQL can be executed correctly,
2, you use the current method of the table name: "recording_table", but you create the name of the table is: mobileTable, you may want to use variable recording_table mobileTable said, in this case I will define the string variable recording_table, and give the recording_table assignment for "mobileTable", recording_table cannot add double quotation marks in the insert method,

CodePudding user response:

You have a problem of create table statements, where sqlite String... Change the text
To study the basic grammar of sqlite under https://www.runoob.com/sqlite/sqlite-create-table.html first
  • Related