I'm looking to understand this:
This results in an error in the log
error in ExecuteMap in dbutils on line:
cur = SQL.ExecQuery2(Query, StringArgs)
java.lang.IllegalArgumentException: Cannot bind argument at index 2 because the index is out of range. The statement has 1 parameters.
But the following works:
Why doesn't the first work?
B4X:
Dim m As Map
m = DBUtils.ExecuteMap(Starter.sql, "SELECT Project, OriginYear, SurveyType FROM tblProjects WHERE Project = ?", Array As String(spnrProject.SelectedItem, Value))
error in ExecuteMap in dbutils on line:
cur = SQL.ExecQuery2(Query, StringArgs)
java.lang.IllegalArgumentException: Cannot bind argument at index 2 because the index is out of range. The statement has 1 parameters.
But the following works:
B4X:
Dim m As Map
Dim strProject As String
strProject = spnrProject.SelectedItem
m = DBUtils.ExecuteMap(Starter.sql, "SELECT Project, OriginYear, SurveyType FROM tblProjects WHERE Project = ?", Array As String(strProject))