Android sqlite string parameter value not working. For example,
SELECT t0.id FROM Employer t0
WHERE (select count(t1.id) from Employee t1 where t1.employerId=t0.id) > ?
The parameter(?) value is a Number. Android sqlite needs parameter values to be String.
rawQuery(sql, String[] arguments)
From sqlite3 console:
If passing the parameter value as string such as "1", the query will always return empty set.
SELECT t0.id FROM Employer t0
WHERE (select count(t1.id) from Employee t1 where t1.employerId=t0.id) > '1'
If It is a number such as 1:
SELECT t0.id FROM Employer t0
WHERE (select count(t1.id) from Employee t1 where t1.employerId=t0.id) > 1
Works.
how to pass the number as a parameter value for the example above?