I want to select some rows based on the LOCID. How ever I cant write the where clause it is giving a compile error saying incompatible operand types saying String and int.
String selectQuery = "SELECT * FROM " + TABLE_LOCATIONAPPS + " WHERE "
+ KEY_LOCID == id;
here is the create query,
String query1 = "CREATE TABLE " + TABLE_LOCATIONLABLES + "("
+ KEY_LOCID + " INTEGER PRIMARY KEY," + KEY_LOCNAME + " TEXT,"
+ ")";
LOCID type is int what may be the reason?
You are not constructing the string properly. You need to have the equal comparison as part of the string.
This is just one example of why manually constructing SQL strings is not a great idea. In addition to these types errors, you are leaving yourself open to SQL Injections issues. This is when you input is not properly sanitized and the SQL command ends up executing something you did not intend.