Simple stored Procedure INSERT statement
BEGIN INSERT into VALUES (ten,3,'2013-01-02',9); #RoauDtine Body goes here ... Select -- indicates the number of rows affected END
Simple stored Procedure ifelse statement (UserID In,username is out)
BEGIN IFUserid= - Then SETUserName= '5'; END IF; IFUserid= - Then SETUserName= '4'; END IF; #Routine body goes here ...,END
The simple stored Procedure IfElse statement (UserID is In,username is out), the problem here is that the select return quantity and the results of the normal query are inconsistent, and later changed several parameters, and finally determined that the UserID and the UserID in the table repeatedly caused, And the case is indistinguishable, so change it to USERID1
BEGIN if(username>5) Then Select Count(*) fromUserAccountwhereUserid> -; #Routine body goes here ...ELSE SETUserid1=4;End if ; END
MySQL Stored Procedures-Summary Learning