The EXECUTE_AND_FETCH function executes a specified cursor and fetch rows.
This function is similar to the combination of the EXECUTE and FETCH_ROWS functions. To operate a remote database, you can call the EXECUTE_AND_FETCH function to reduce the number of round trips on the network. The EXECUTE_AND_FETCH function returns the number of rows actually extracted.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
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 that you want to execute. |
| exact | If this parameter is set to TRUE, an exception will be thrown when the number of rows in the result set is not equal to 1. The rows can still be extracted and used even if an exception is thrown. |
Return values
The specified rows are returned.