Purpose
You can use this statement to prepare a statement.
Syntax
PREPARE stmt_name FROM preparable_stmt
Parameters
| Parameter | Description |
|---|---|
| stmt_name | The name of the PREPARE statement. |
| preparable_stmt | The SQL statement to be executed. |
Examples
Execute the PREPARE statement.
obclient> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
Query OK, 0 rows affected (0.01 sec)
obclient> SET @a = 3;
Query OK, 0 rows affected (0.00 sec)
obclient> SET @b = 4;
Query OK, 0 rows affected (0.00 sec)
obclient> EXECUTE stmt1 USING @a, @b;
Query OK, 0 rows affected (0.00 sec)
Note
Currently, OceanBase Database does not display the results on interactive clients.