I am am MS SQL developer and I am busy trying to migrate over to MySQL. I need to populate a table for testing and I would like to do this using a while loop. I noticed that MySQL does support the while conditional statement but for some reason it does not want to work. I noticed that is I wrap it in a stored procedure then it works fine????
Please tell me if I can run a while loop directly or are all conditional statements limited to stored procedures and functions?
Set @i = 0;
while @i < 1000000 do
Insert into payment_instructions (acc_no,acc_type,br_code,br_name,bank_name,instr_val,dt_date)
Set @i = @i+1;