Kbase P122687: Inconsistent types (7481) when using Logical fields.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  07/03/2007 |
|
Status: Unverified
SYMPTOM(s):
Inconsistent types (7481) when using Logical fields.
SQL expression contains a boolean datatype
select CASE WHEN coveredonbenefits = 'Yes' THEN '1'
ELSE '2'
END
from pub.family;
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=20008
[DataDirect][OpenEdge JDBC Driver][OpenEdge] Inconsistent types (7481)
CAUSE:
As per the SQL Standard, correct boolean values are either 1 = yes or 0 = no.
FIX:
Change the expression to contain either 1 or 0 instead of 'Yes' or 'No'.
Example:
select CASE WHEN coveredonbenefits = 1 THEN '1'
ELSE '2'
END
from pub.family;