创建存储过程mysql>delimiter$--delimiter$是设置$为命令终止符号,代替默认的分号,因为分号有其他用处.mysql>createproceduresp_test(INpi_idint,OUTpo_namevarchar(10))->begin->select*fromtest.tb_test->selecttb_test.nameintopo_namefromtest.tb_testwheretb_test.id=pi_id->end->$QueryOK,0rowsaffected(0.00sec)mysql>delimiter--恢复分号作为分隔终止符号5.调用存储过程mysql>set@po_name=""QueryOK,0rowsaffected(0.00sec)mysql>callsp_test(1,@po_name)
Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号