Subject Re: [firebird-support] Switch statement in FIREBIRD
Author Mr. John
Thanks Milan
'execute procedure' was just an example,there could be other statements.I'll use IF, ELSE IF and ELSE instead.Thanks.

From: Milan Babuskov <milanb@...>
Sent: Fri, December 4, 2009 6:32:13 PM
Subject: Re: [firebird-support] Switch statement in FIREBIRD

Mr. John wrote:
> Thanks Milan.
> I'm looking for a C++ swich functionality

But what is the end result: execution of a statement or retrieval of
some value? If you just want to execute procedure which does not return
any database, you shouldn't SELECT at all - select should be used only
when you want to retrieve some data.

In short, I don't think there is a switch statement equivalent in PSQL.
Use IF, ELSE IF and ELSE instead:

if (new.tip = 1) then execute procedure pr1;
else if (new.tip = 6) then execute procedure pr2;
else execute procedure pr3;

Milan Babuskov

============ ========= ========= ====
The easiest way to import XML, CSV
and textual files into Firebird:
============ ========= ========= ====

[Non-text portions of this message have been removed]