Special attention to the location of the symbol and there is NO!!!
First create the table T_user:
Delimiter as the start and end of execution:
Create a stored procedure Pro_user (), define a variable:
Then create a stored procedure and assign a value to the variable:
Call stored Procedure Pro_user2 ():
Next, create the table t_user2 and insert a data from the table into the table T_user:
First create the table T_user2:
Then create the stored procedure Pro_user3 () and insert the T_USER2 data into the T_user:
Call the T_user before the stored function Pro_user3 ():
Then: Call Pro_user3 ();
T_user after calling Pro_user3 (): Inserts the data id2=1 in T_user2.
Next is the use of cursors:
Insert T_user2 data into table T_user with a cursor:
First create a stored procedure and make a cursor declaration, open, use, close:
T_user before calling the stored function pro_user4 ():
After the call:
Next, the use of Process control:
Create a stored procedure 5 and operate on T_user:
If you can find the data to update, otherwise insert a piece of data into the table T_user:
T_user Raw DATA:
To execute the call store function:
For table T_user Operations, use case:
T_user before calling the stored function:
After the call:
LOOP, leave statement:
Calling a stored function: Inserting data continuously into a table
Next:
Itearate statement: equivalent to continue.
The result can be seen that id=3 is skipped and not shown:
Next Repeat statement:
Special attention to symbol position and there is no!!!
Stop inserting data to 5!
Next while statement:
Use of variables, use of cursors, use of process controls