MySQL: create stored procedure and cursor example