I can't seem to find why this gives me an error. It can't use the variable 'art' in the loop. But when I just do
select art;
It gives me the correct number of items.
drop procedure if exists bepaal_lijst_van_bij_te_bestellen_artikelen;
delimiter //
create procedure bepaal_lijst_van_bij_te_bestellen_artikelen()
begin
DECLARE art INT;
DECLARE i INT;
SELECT @art := COUNT(artikel_id) FROM artikelen;
SET i = 1;
WHILE i <= art DO
END WHILE;
end;
//
delimiter ;
bepaal_lijst_van_bij_te_bestellen_artikelen! was there nothing simpler to choose?