I have a rawQuery string running but SQlite throws this warning :
SQLiteDirectCursorDriver(1058): Found SQL string that ends in ;
because of quote issues. So I’m trying to use SelectionArgs in a query where I do not have really replacement by values, like this :
String query = "SELECT Min(?) as oldest, Max(?) as newest, COUNT(?) as nb_data FROM ? WHERE ? BETWEEN (SELECT Min(?) FROM ?) AND (SELECT Max(?) FROM ?)";
String[] values = new String[] { TS, TS, col_2, table, TS, TS, table, TS, table };
Cursor mCount = database.rawQuery(query, values);
I can’t get it working, even using fewer SelectionArgs strings (only on the “WHERE” part of the query) as there is not really value replacement requirements but placeholders.
Is there a solution to set this prepared statement (using placeholders rather than using quotes or rewriting the original query) to avoid getting the SQLiteDirectCursorDriver warning ?
You can use parameters only for expressions, not for identifiers.
To prevent this warning, just omit the semicolon from the end of your SQL query strings.