Firebird CASE statement inside stored procedure

I tried to use the instruction caseinside the stored procedure, but "Token unknown" was found on it. casenot supported in stored procedure? Thanks

+5
source share
2 answers

You can use the CASE statement only in the SELECT statement. Offline use is not allowed.

+2
source

As Andrei wrote, it CASEis available only in operations SELECT. Thus, the trick for using it is to select from a table that has only one row, for example RDB$DATABASE:

SELECT
  CASE
    ...
  END
FROM RDB$DATABASE INTO :myVAR;

, , , , IF / ELSE.

+6

All Articles