Hello, Alexander!
You wrote to St. Alex on Thu, 18 Oct 2007 09:07:15 +0600:

execute block
returns (a_missed integer)
as
declare variable a_min integer;
declare variable a_max integer;
begin
 a_missed=2000;
 a_max=2007;
 while (a_missed <=:a_max) do
 begin
   if (not exists (select * from prd where nyear=:a_missed)) then suspend;
   a_missed=a_missed+1;
 end
end

Так читабельнее имхо. А идея правильная. Как раз тот случай, когда execute block к нужному месту приходится. :)
--
Удач
Alexander A. Venikov, Tobolsk, Russia

Ответить