The OPEN_CURSOR function opens a new cursor.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_SQL.OPEN_CURSOR
RETURN INTEGER;
DBMS_SQL.OPEN_CURSOR
RETURN INTEGER;
DBMS_SQL.OPEN_CURSOR(
security_level IN INTEGER)
RETURN INTEGER;
Parameters
| Parameter | Description |
|---|---|
| security_level | Specifies the level of security protection to enforce on the opened cursor. Valid values are 0, 1, and 2. Security levels:
|
Return values
The ID of the new cursor is returned.
Considerations
You must close the cursor by calling
CLOSE_CURSORwhen you no longer need it.You can use a cursor to execute the same SQL statement repeatedly or execute a new SQL statement. When you reuse a cursor to parse a new SQL statement, the content of the corresponding cursor data area is reset. You do not need to close and reopen a cursor before you reuse it.