Kbase P67590: [JDBC Progress Driver]:Inconsistent types (7481) when substr
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  13/02/2004 |
|
Status: Unverified
SYMPTOM(s):
=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-20008
[JDBC Progress Driver]:Inconsistent types (7481)
SQL query contains a CASE with > 1 WHEN closes and each WHEN close contains a substring with a character string
EXAMPLE:
select
case
when grantee = 'ces' then
substring('1234567/890', 4, 3)
when grantee = 'sha' then
substring('1234567/890', 5, 3)
else substring('1234567/890', locate('/', '1234567/890') + 1, 3)
end
from sysprogress.sysdbauth
FIX:
A workaround can be:
select
decode(grantee,
'ces', substring('1234567/890', 4, 3),
'sha', substring('1234567/890', 5, 3),
substring('1234567/890', locate('/', '1234567/890') + 1, 3))
from sysprogress.sysdbauth