Stored Procedure to return all dates in a range

Abstract: Stored Procedure to return all dates in a range

create procedure alldates (d1 date, d2 date)
returns (thedate date)
as begin
while (d2 > d1) do
begin
  thedate = d1;
  d1 = d1 + 1;
  suspend;
end
end;
Sample Usage:
select * from alldates('1/1/04',current_timestamp);