CREATE DEFINER=`root`@`localhost` PROCEDURE `YeniProsedur`(`Param` int(11)) BEGIN DECLARE v1 INT DEFAULT 5; DECLARE Rand_IL int(10); DECLARE Rand_ILCE int(10); DECLARE RandDateStart int(10); DECLARE RandDateEnd int(10); DECLARE RasTarih datetime; DECLARE RasSayi int(10); WHILE v1 > 0 DO SET Rand_IL = (select id from iller order by rand() limit 1); SET Rand_ILCE = (select id from ilceler where sehirid=Rand_IL order by rand() limit 1); SET RandDateStart = UNIX_TIMESTAMP('2010-01-01'); SET RandDateEnd = UNIX_TIMESTAMP('2010-09-01'); SET RasTarih = (SELECT FROM_UNIXTIME(RAND() * (RandDateEnd - RandDateStart) + RandDateStart)); SET RasSayi = rand()*(999999-10)+10; /*INSERT INTO ##RasSayi##RasTarih##Rand_IL##Rand_ILCE##;*/ SET v1 = v1 - 1; END WHILE; END; /*5 adet rasgale veri atıyor dbye,*/