Switch to: V9V8V7V6V5
Table of Contents

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 }