vinuthna alla
vinuthna alla

Reputation: 21

I'm working on sqlite and cannot figure out the error in the string

String index=" CREATE INDEX "+index_name+" on "+table_name+" ";

Error occurs near index_name. I have tried inserting an additional ";" to indicate statement end but it didn't work.

ERROR: android.database.sqlite.SQLiteException: near "index_d": syntax error (code 1): , while compiling: CREATE INDEX result_vinu1 on index_d

Upvotes: 0

Views: 61

Answers (1)

Ankur Khandelwal
Ankur Khandelwal

Reputation: 107

In index, there should be column.

String index=" CREATE INDEX "+index_name+" on "+table_name+" (col_name) ";

Upvotes: 1

Related Questions