create PROCEDURE result(in n int,out total int) #執行過程開始begin#存貯過程當中變量的定義 declare num int default 0; set total :=0; while num<n do set num :=num+1; set tatal :=total+num; end while; end