1
Good evening guys, I always used Firebird, but I decided to try the 2017 Interbase for mobile apps. The following SQL works normally on Firebird and Sqlite. But I’m racking my brain trying to make it work on Interbase 2017. If I remove Case parameters the code works.
SELECT P.ID_PESSOA,
P.RAZAO_SOCIAL,
P.NOME_FANTASIA,
P.ID_CATEGORIA,
P.TIPO_PESSOA,
P.NUMERO,
P.ID_ENDERECO,
P.BAIRRO,
E.ENDERECO,
E.ENDERECO || ', ' || P.NUMERO || ' ' || P.BAIRRO AS ENDERECO_COMPLETO
FROM PESSOA P
JOIN ENDERECO E ON (P.ID_ENDERECO = E.ID_ENDERECO)
WHERE P.ID_CATEGORIA = CASE :ID_CATEGORIA WHEN 0 THEN P.ID_CATEGORIA
ELSE :ID_CATEGORIA
END
Good morning buddy, it worked perfectly! Thank you so much for your help!!!
– Tallys Ferrante