Subject | Re: [firebird-support] IF condition |
---|---|
Author | Helen Borrie |
Post date | 2007-04-04T10:19:23Z |
At 07:54 PM 4/04/2007, you wrote:
IF (EXISTS (SELECT 1 FROM TEMP WHERE FLAG = 1)) THEN
BEGIN
...
END
But, FYI, in PSQL, SELECT statements that return output always have
to return it into variables.
./hb
>Hi! In an IF condition is it possible to use a SELECT? Like this one:Use EXISTS:
>
>
> IF (SELECT COUNT(*) FROM TEMP WHERE (FLAG = 1) > 0) THEN
>BEGIN
>...
> END
>
> I did it this other way:
>
> SELECT COUNT(*) FROM TEMP WHERE FLAG = 1 INTO :MAS30;
> IF MAS30>0 THEN
> BEGIN
> END
>
> But just to know..
>
> In InterBase 7.5 I'm getting an error if I use the SELECT in the condition
IF (EXISTS (SELECT 1 FROM TEMP WHERE FLAG = 1)) THEN
BEGIN
...
END
But, FYI, in PSQL, SELECT statements that return output always have
to return it into variables.
./hb