mysql 返回查詢數(shù)量,如何接收函數(shù)返回值?mysql中要獲得存儲過程的返回值,可以增加一個out參數(shù),用來返回。mysql中存儲過程的例子:CREATE PROCEDURE addvoucher (IN userid INT,IN voucherid INT,OUT result INT)BEGINSELECT@endate_a := endate ,@batch_a := batch ,@c_count_a := c_count,@isdead_a := isdeadFROMt_voucherWHEREid = voucherid;SET autocommit = 0;IF EXISTS (SELECT*FROMt_user_voucher tuv,t_voucher tvWHEREtv.id = tuv.voucheridAND tv.batch =@batch_a) THENSET result = 1;-- 已存在SELECTresult;ELSEIF @c_count_a > 0 THENIF (TO_DAYS(@endate_a) - TO_DAYS(NOW())) > 0 THEN
網(wǎng)站導(dǎo)航
- zblogPHP模板zbpkf
- zblog免費模板zblogfree
- zblog模板學(xué)習(xí)zblogxuexi
- zblogPHP仿站zbpfang