看個具體的例子:
在TEST資料庫中建立一個存儲過程,名為getRecord:

這個存儲過程接受學生ID為輸入,輸出為學生的名字和年齡,實作一個簡單的查詢功能。
存儲過程建立完畢後,用如下的指令行查詢其狀态:
另外一條查詢指令:
MySQL裡的information_schema.Routines這張表類似SAP ABAP裡的TADIR(對象系統資料庫),是以我們也可以查詢該表裡對應的存儲過程的記錄:
select * from information_schema.Routines where routine_name = ‘getRecord’ and routine_type = ‘procedure’ \G;