Subject Re: [firebird-support] Switch statement in FIREBIRD
Author Milan Babuskov
Mr. John wrote:
> Hi, I use firebird 2.1
> I have inside SP :
> IF (NEW.TIP=1) THEN EXECUTE PROCEDURE PR1
> IF (NEW.TIP=6) THEN EXECUTE PROCEDURE PR2
> IF (NEW.TIP<>6 AND NEW.TIP<>1) THEN EXECUTE PROCEDURE PR3
>
> And I want something like this :
>
> SELECT CASE (NEW.TIP)
> CASE 1
> EXECUTE PROCEDURE PR1
> CASE 6
> EXECUTE PROCEDURE PR2
> CASE ELSE
> THEN EXECUTE PROCEDURE PR3
> END CASE

I assume PR1, PR3 and PR3 return a single column?

In that case, you need to select from them. Instead of EXECUTE use (
SELECT * FROM PR1) , etc.


--
Milan Babuskov

==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================