Subject Re: [firebird-support] If and For Select
Author Milan Babuskov
paultugwell wrote:
> if (X=0) then
> for select a from b into :c
> else
> for select a from b where z = :x into c
>
> Is this possible?

Yes.

> If so, how would I code the for select statements?

You can use EXECUTE STATEMENT for example:

declare variable stmt varchar(100);
...
if (x = 0) then
stmt = 'select a from b';
else
stmt = 'select a from b where z = '||x;
for execute statement :stmt into :c do
begin
...
end


--
Milan Babuskov
http://www.guacosoft.com