Re: two tables into one cursor by Sietse
Sietse
Thu Dec 02 06:14:50 CST 2004
Hi Mohammed,
Use the UNION statement:
select sid, sname from students into;
UNION ;
select did, dname from departments into Cursor sCurs
I don't know if you need to know which is which in the resultset, but you
can do that by adding a custom type field:
select sid, sname, "S" AS Type from students into;
UNION ;
select did, dname, "D" AS Type from departments into Cursor sCurs
HTH,
Sietse Wijnker
"Mohammed Abdel-Razzak" <MohammedAbdelRazzak@discussions.microsoft.com>
wrote in message news:DCA24741-CA6B-4ACA-8BD9-685B0331A176@microsoft.com...
> Dear sirs
> Is there any way enables me to put the output of two SELECT statements
> into
> one cursor
> ex:
> select sid, sname from students into Cursor sCurs
> select did, dname from departments into Cursor sCurs
>
> so sCurs has the values of the two tables
> can I do that?? and how??
>
> thanks
> Mohammed
>