I tried looking on google but without luck…
I have a SELECT SQLStatement and I want to use the LIKE operator but the parameters won’t work and the query give me an error
public function getUsersList(username:String):SQLStatement
{
selectRecord= new SQLStatement();
selectRecord.sqlConnection = connection;
selectRecord.text =
"SELECT id_user, username,password,profile,leg_cliente " +
"FROM userlist " +
"WHERE username like '%:username%'";
selectRecord.parameters[":username"] = username;
return selectRecord;
}
The error I got is
‘:username’ parameter name(s) found in parameters property but not in
the SQL specified.
I solved putting the wildcard
%in the parameters instead of the statement…The starting problem was triggered because the query was like
Putting the single quote in the statement won’t let the statement to set the parameter, I suppose because the parameter key (in statement.text) is seen as a text and not a parameter itself…