You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while trying to build a query with a BIT_AND condition on a parameter in a Group Concat select statement.
The problematic line is:
The query (the aidant parameter is set later in a simple where clause, so it does exists in the query):
If I execute the query, I get an exception "the query define 1 parameter but you bound 2"
If I comment the "setParameter("teacherLeaved", STATUT)", I get an exception "the query define 2 parameters but you only bound 1"
If I explicitly define the value in the select BIT_AND and remove the "setParameter("teacherLeaved")", everything works well.
I'd tried to use BIT_AND(aa.status, (:teacherLeaved param)) as described here, for param in a select but it don't work neither (i also tried without the "param" at the end of the parenthesis).
I don't really get the point here, is there a reason or is it a lack of support for this kind of usage?
Right now to make it work, i'm just concatenating my value in the select clause and it works like a charm, but i would like to understand the problem.
The text was updated successfully, but these errors were encountered:
CabanesThibault
changed the title
Cannot use parameter in Select Group by with BIT_AND IF condition
Cannot use parameter in Select Group Concat with BIT_AND IF condition
Jun 21, 2024
Hi,
I encountered an issue while trying to build a query with a BIT_AND condition on a parameter in a Group Concat select statement.
The problematic line is:
The query (the aidant parameter is set later in a simple where clause, so it does exists in the query):
If I execute the query, I get an exception "the query define 1 parameter but you bound 2"
If I comment the "setParameter("teacherLeaved", STATUT)", I get an exception "the query define 2 parameters but you only bound 1"
If I explicitly define the value in the select BIT_AND and remove the "setParameter("teacherLeaved")", everything works well.
I'd tried to use BIT_AND(aa.status, (:teacherLeaved param)) as described here, for param in a select but it don't work neither (i also tried without the "param" at the end of the parenthesis).
I don't really get the point here, is there a reason or is it a lack of support for this kind of usage?
Right now to make it work, i'm just concatenating my value in the select clause and it works like a charm, but i would like to understand the problem.
The text was updated successfully, but these errors were encountered: