Subject Re: [firebird-support] Firebird SP Question
Author Helen Borrie
At 07:24 PM 3/06/2006, Luc the Auctioneer wrote:
>If you have a select like this:
>
>FOR SELECT <FIELDS> from TABLE1

...
order by ...

>INTO <return_variables>
>DO BEGIN
> SUSPEND;
>END
>
>FOR SELECT <FIELDS> from TABLE2

...
order by ...

>INTO <return_variables>
>DO BEGIN
> SUSPEND;
>END
>
>will retunr you all records from table1 with no values for table2 and
>then all records from table2 (with the values from the last record of
>table1).
>This doesn't seem to be anything that anyone might want, but should give
>you the idea.

It's a "mock union", Luc. With a real union, you can't get the
separate unioned sets each having its own order, so this is the only
way I know to get that.

Myles wants to run the two queries both over the same table, and
that's OK too. No aliases needed, because you have finished with the
first cursor once you start the second query.

./heLen