Subject Re: [firebird-support] Conditional syntax in stored procedure?
Author Helen Borrie
At 09:40 PM 21/06/2004 +0000, you wrote:
>Hi All,
>
>How would I convert this Delphi code to a stored procedure?
>
>if this and that and theother then
> DoSomeCoolStuff
>else if (not (this and that)) then
> DoSomeOtherCoolStuff;
>
>The stored procedure doesn't seem to like the "and" operator and I
>don't find a reference to an alternative.

if (this and that and theother) then
DoSomeCoolStuff;
else if (not (this and that)) then
DoSomeOtherCoolStuff;


i.e. in PSQL, conditions must always be bracketed. Note also the
terminator at the end of the IF branch.

Same applies to WHILE. And you have to be careful to "block" compound
statements with BEGIN and END...and END never takes a terminator inside the
body of the procedure.

/heLen