- String sql;
- String[] params;
- if (profileSpecific) {
- sql = String.format("SELECT %s as a, case when %s_upper LIKE ?||'%%' then 1 " +
- "WHEN %s_upper LIKE '%%:'||?||'%%' then 2 " +
- "WHEN %s_upper LIKE '%% '||?||'%%' then 3 " +
- "else 9 end " + "FROM %s " +
- "WHERE profile=? AND %s_upper LIKE '%%'||?||'%%' " +
- "ORDER BY 2, 1;", field, field, field, field, table, field);
- params = new String[]{str, str, str, Data.profile.get().getUuid(), str};
- }
- else {
- sql = String.format("SELECT %s as a, case when %s_upper LIKE ?||'%%' then 1 " +
- "WHEN %s_upper LIKE '%%:'||?||'%%' then 2 " +
- "WHEN %s_upper LIKE '%% '||?||'%%' then 3 " +
- "else 9 end " + "FROM %s " +
- "WHERE %s_upper LIKE '%%'||?||'%%' " + "ORDER BY 2, 1;",
- field, field, field, field, table, field);
- params = new String[]{str, str, str, str};
- }
- Log.d("autocompletion", sql);
- SQLiteDatabase db = MLDB.getReadableDatabase();
+ String sql;
+ String[] params;
+ if (profileSpecific) {
+ sql = String.format("SELECT %s as a, case when %s_upper LIKE ?||'%%' then 1 " +
+ "WHEN %s_upper LIKE '%%:'||?||'%%' then 2 " +
+ "WHEN %s_upper LIKE '%% '||?||'%%' then 3 else 9 end " +
+ "FROM %s " +
+ "WHERE profile=? AND %s_upper LIKE '%%'||?||'%%' " +
+ "ORDER BY 2, 1;", field, field, field, field, table, field);
+ params = new String[]{str, str, str, Data.profile.get().getUuid(), str};
+ }
+ else {
+ sql = String.format("SELECT %s as a, case when %s_upper LIKE ?||'%%' then 1 " +
+ "WHEN %s_upper LIKE '%%:'||?||'%%' then 2 " +
+ "WHEN %s_upper LIKE '%% '||?||'%%' then 3 " + "else 9 end " +
+ "FROM %s " + "WHERE %s_upper LIKE '%%'||?||'%%' " +
+ "ORDER BY 2, 1;", field, field, field, field, table, field);
+ params = new String[]{str, str, str, str};
+ }
+ Log.d("autocompletion", sql);
+ SQLiteDatabase db = MLDB.getDatabase();