DYNAMIC RESULT SETS 1
LANGUAGE SQL
ss: BEGIN


	            BEGIN
					    DECLARE crs CURSOR WITH RETURN FOR
						 SELECT b.BmsID,
					            b.BmsName,
					            occ.StartRow,
					            occ.EndRow,
					            occ.StartCol,
					            occ.EndCol,
					            pth.PathStr,
					            Bms_1.BmsName AS MAP_SET,
					            b.occurid
					     FROM Bms b
					          LEFT OUTER JOIN Occurrences occ ON b.OccurID = occ.OccurID
					          LEFT OUTER JOIN Paths pth ON pth.PathID = occ.PathID
					          LEFT OUTER JOIN Bms Bms_1 ON b.AncestorID = Bms_1.BmsID
					     WHERE
						       b.BmsID IN (SELECT * FROM SESSION.numeric_param_temp) AND 
							   b.IsMapSet = 0;

					           
				       OPEN crs;
				
                END;
END ss	


