0

I'm getting this exception when doing a create view sentence:

04-10 10:09:55.475: E/AndroidRuntime(15451): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mo.activity}: android.database.sqlite.SQLiteException: near "-": syntax error (code 1): , while compiling: CREATE VIEW vNa-MarcadbRESID1dataV18 AS SELECT * FROM ITEMS WHERE 1  AND ( 1 != 1 OR Column7 = 1 )

Where is the problem?

vNa-MarcadbRESID1dataV18 is not a valid name for a View in sqlite?

NullPointerException
  • 36,107
  • 79
  • 222
  • 382

1 Answers1

0

Identifiers such as view names cannot contain - - it parses as subtraction expression. Either rename it or quote it in `backticks` or "double quotes".

laalto
  • 150,114
  • 66
  • 286
  • 303
  • 1
    Identifiers [are quoted with `"double quotes"`](http://www.sqlite.org/lang_keywords.html); backticks are supported only for bug-compatibility with MySQL. – CL. Apr 10 '14 at 16:45