1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
create trigger af_ins_livraison on livraison
after insert as
begin
declare cLesAjouts cursor for select idClient, Numdebut, Numfin from livraison;
declare @debut int;
declare @fin int;
declare @idClient varchar(8);
declare @i int;
open cLesAjouts;
fetch cLesAjouts into @idClient, @debut, @fin;
while (@@fetch_status=0) begin
set @i=@debut;
while (@i<=@fin) begin
insert into fiches values (@idClient, @i);
set @i=@i+1;
end ;
fetch cLesAjouts into @idClient, @debut, @fin;
end;
close cLesAjouts;
deallocate cLesAjouts;
end; |
Partager