>combine the 3 cursors into one cursor used in the label report. I can't
>figure out how to combine the 3 cursors into 1 cursor. Or should I go about
>this some other way?
>
>Shane Gilbert
You'd have to find a common denominator to their structures and then do
an select union of them, resulting in one cursor, about this
select code, name, address, phone from firstcursor;
union (select code, nickname as name, ;
str(houseno,3,0)+' '+trim(street) as address, " " as phone ;
from secondcursor);
union (select " " as code, ;
trim(firstname)+' '+lastname as name, address, phone ;
from thirdcursor);
order by 2,3 into cursor finalcursor
Here I have assumed you want to keep the structure of the first cursor,
and the second and third have slightly different structures so you'd
have to manipulate fields to get the same structure as in the first one.
When making Unions, you have to make sure that the resulting fields in
all the selects match; for strings the length doesn't matter much
(length is taken from the first Select), but for numbers it does - it
tends to report errors when their sizes differ. This comes from SQL's
measuring the width by what it finds in the first record, and it
probably doesn't find equally sized numbers in all of the Unioned tables
or cursors. The workaround is to select 0000000.00+numeric_field - the
resulting number has as many places as you give it zeros; do the same in
all the selects and it'll work.