Purpose
This statement is used to execute prepared statements.
Syntax
EXECUTE stmt_name
[USING @var_name [, @var_name] ...]
Parameters
Parameter |
Description |
|---|---|
| stmt_name | The name of the prepared statement. |
| @var_name | Enter in order stmt_name of variables. |
Examples
Statements prepared for execution.
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 value:
+------------+
| hypotenuse |
+------------+
| 5 |
+------------+
1 row in set (0.004 sec)
Note
Currently, OceanBase AI Database does not support explicitly displaying results in the interactive client.