萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> mySql存儲過程的結構

mySql存儲過程的結構

 無參數的存儲過程

? 1 2 3 4 5 6 7 CREATE PROCEDURE P_XSRBB() BEGIN         DECLARE VP1 VARCHAR(20);         SET VP1=4; SELECT VP1 FROM DUAL; END; CALL P_XSRBB();

帶輸入參數的存儲過程

? 1 2 3 4 5 6 7 8 DROP PROCEDURE IF EXISTS P_XSRBB; CREATE PROCEDURE P_XSRBB(in vp2 INT) BEGIN         DECLARE VP1 VARCHAR(20);         SET VP1=4; SELECT VP2 FROM DUAL; END; CALL P_XSRBB(3434);
copyright © 萬盛學電腦網 all rights reserved