When I try to execute the following select SQL statement:
1 2 3 4 5 | select case when (domain_projects <> :domain_projects) then true else false end as result from project where domain_classifier = true and id = :projectId and domain_projects is not null |
I get this error message:
org.postgresql.util.PSQLException: ERROR: operator does not exist: text = bytea Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
How-To
The problem result from the first line:
1 2 3 4 5 | select case when (domain_projects <> :domain_projects) then true else false end as result from project where domain_classifier = true and id = :projectId and domain_projects is not null |
I need to cast the parameter to specific data type as per instructions. Therefore, the SQL statement should be modified as bellows:
1 2 3 4 5 6 | select case when (domain_projects <> cast(:domain_projects as text)) then true else false end as result from project where domain_classifier = true and id = :projectId and domain_projects is not null |
No comments:
Post a Comment