The EXECUTE_AND_FETCH function is used to execute a specified cursor and retrieve rows.
This function provides the same functionality as calling EXECUTE and FETCH_ROWS. When working with remote databases, using EXECUTE_AND_FETCH can reduce the number of round trips. The EXECUTE_AND_FETCH function returns the number of rows actually fetched.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_SQL.EXECUTE_AND_FETCH (
c IN INTEGER,
exact IN BOOLEAN DEFAULT FALSE)
RETURN INTEGER;
Parameters
| Parameter | Description |
|---|---|
| c | The ID of the cursor to execute. |
| exact | If set to TRUE, an exception is raised when the number of records in the result set of the actual query is not equal to 1. Even if an exception is raised, rows can still be fetched and used. |
Return value
Returns the specified rows.
