java - How come i get a syntax error code 1 in this simple sqlite query -


I have found a sqlite query that looks like this:

  string sql_group = " Create a table group (id VARCHAR (25), name VARCHAR (25), account_id VARCHAR (25)); "  

And when I do:

  Db.execSQL (sql_group);   

This gives a serious error, I have a syntax error code 1 while compiling.

I do not know what this is.

Because GROUP , which is the name of your table, a reserved keyword is. You still use it but you have to remove it from brackets ,

  string sql_group = "create table [group] (id varchar (25), ... ...   
  • But I suggest you use such names to avoid problems in the future. Should be avoided.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -