Purpose
This statement is used to execute a prepared statement.
Syntax
EXECUTE stmt_name
[USING @var_name [, @var_name] ...]
Parameters
| Parameter | Description |
|---|---|
| stmt_name | The name of the prepared statement. |
| @var_name | The variables to be filled in the stmt_name statement. |
Examples
Execute a prepared statement.
obclient> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
obclient> SET @a = 3;
obclient> SET @b = 4;
obclient> EXECUTE stmt1 USING @a, @b;
Expected return result:
+------------+
| hypotenuse |
+------------+
| 5 |
+------------+
1 row in set (0.004 sec)
Note
Currently, OceanBase Database does not support interactive clients explicitly returning results.
