Mysql generates a complete Stored Procedure Definition Statement. mysql Stored Procedure
Select concat ('pr _ ', p. db ,'. ', p. name) FileName, CONCAT ('delimi', 'TER $ USE '', p. db, ''$ drop procedure if exists'', p. name, ''$ create definer = ', ''', LEFT (DEFINER,-1 + LOCATE (' @ ', DEFINER )),''@'', RIGHT (DEFINER, LENGTH (DEFINER)-LOCATE ('@', DEFINER), ''', 'processed', p. name, ''(', p. param_list, ')', p. body_utf8, '$ DELIMI', 'TER;') AS SQL _create FROM mysql. proc AS p WHERE p. db LIKE '%' and type like 'proc % 'order by p. db, p. name;
In MySQL, how does one write SQL statements to call stored procedures?
Call sp_add ();
Is there a problem with the process you defined, and the returned results are not pointed out?
Like me:
Create procedure sp_add (a int, B int, out c int)
Begin
Set c = a + B;
End;
Call process:
Call sp_add (1, 2, @ );
Select @;
How does mysql execute block statements without creating functions or stored procedures?
Mysql does not have the concept of blocks. Separate blocks are as follows:
BEGIN
Insert into liu_test VALUE ('A', 'bb ');
END
Such blocks cannot be executed.
The best way to execute a block separately is to create a stored procedure, and delete the stored procedure after execution.