Up to now I've been trying a lot of times to bind SQLite selection arguments in queries like the best practices suggest. But it rarely worked. I'm curious about the exact reason. Now I realized that it may be caused by the sub-queries in the FROM clause. For example...
SELECT X(result) as x, Y(result) as y, Z(result) as z FROM (select Transform(MakePointZ(?, ?, 0.0, ?), ?) as result);
and the Java code is something like...
double x, y, z;
int source, target;
final String[] selectionArgs = new String[] {
String.valueOf(x),
String.valueOf(y),
String.valueOf(z),
String.valueOf(source),
String.valueOf(target) };
Cursor c = db.rawQuery(sql, selectionArgs);
Could someone confirm if using arguments outside the WHERE clause is error or explain me where the arguments are fine to be placed?
P.s. I actually use Spatialite which is an extension to SQLite but it is based on a pure and untouched SQLite.