CALL
This statement allows to invoke an existed stored procedure or function by its name.
Syntax
CALL sp_name( [parameter [,...] ] ) CALL sp_name[ () ]
Arguments
sp_name
The name of procedure that should be invoked.
parameter
The name of variable to be passed into routine.
Examples
CREATE PROCEDURE p (OUT ver_param VARCHAR(25), INOUT incr_param INT) BEGIN # SET VALUE OF OUT parameter SELECT VERSION() INTO ver_param; # INCREMENT VALUE OF INOUT parameter SET incr_param = incr_param + 1; END;
Later
SET @INCREMENT = 10; -- call procedure that returns the engine version into variable @version. -- and increments the value of @increment variable, so it becomes 11. CALL p(@version, @INCREMENT);
Now you can get values of variables using SELECT statement.
curs = db.SqlSelect( "SELECT @version, @increment;" ); -- result is cursor with one record as { "3.0.1", 11 }