Prova detta VÄLJ en databas först, annars får du felet ingen databas vald
DROP PROCEDURE IF EXISTS myFunction;
delimiter $$
CREATE PROCEDURE myFunction()
BEGIN
DECLARE i INT DEFAULT 1;
DECLARE j INT DEFAULT 0;
DROP TABLE IF EXISTS test;
CREATE TEMPORARY TABLE test
(id int, numbers int);
WHILE (i<=100) DO
SET j=i+2560;
INSERT INTO test VALUES(i,j);
SET i=i+1;
END WHILE;
select * from test;
drop table test;
END$$
Ring sedan proceduren
delimiter ;
call myFunction();