Purpose
You can use this statement to execute a prepared statement produced with PREPARE.
Syntax
EXECUTE stmt_name
[USING @var_name [, @var_name] ...]
Parameters
| Parameter | Description |
|---|---|
| stmt_name | The name of the prepared statement. |
| @var_name | The variables sequentially filled in stmt_name. |
Examples
Execute a prepared statement.
obclient> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
Query OK, 0 rows affected
obclient> SET @a = 3;
Query OK, 0 rows affected
obclient> SET @b = 4;
Query OK, 0 rows affected
obclient> EXECUTE stmt1 USING @a, @b;
Query OK, 0 rows affected
Note
Currently, OceanBase Database does not display the results on interactive clients.