Share via


Working with Oracle REF CURSORsĀ 

The .NET Framework Data Provider for Oracle supports the Oracle REF CURSOR data type. When using the data provider to work with Oracle REF CURSORs, you should consider the following behaviors.

Note

Some behaviors differ from those of the Microsoft OLE DB Provider for Oracle (MSDAORA).

  • For performance reasons, the Data Provider for Oracle does not automatically bind REF CURSOR data types, as MSDAORA does, unless you explicitly specify them.

  • The data provider does not support any ODBC escape sequences, including the {resultset} escape used to specify REF CURSOR parameters.

  • To execute a stored procedure that returns REF CURSORs, you must define the parameters in the OracleParameterCollection with an OracleType of Cursor and a Direction of Output. The data provider supports binding REF CURSORs as output parameters only. The provider does not support REF CURSORs as input parameters.

  • Obtaining an OracleDataReader from the parameter value is not supported. The values are of type DBNull after command execution.

  • The only CommandBehavior enumeration value that works with REF CURSORs (for example, when calling ExecuteReader) is CloseConnection; all others are ignored.

  • The order of REF CURSORs in the OracleDataReader depends on the order of the parameters in the OracleParameterCollection. The ParameterName property is ignored.

  • The PL/SQL TABLE data type is not supported. However, REF CURSORs are more efficient. If you must use a TABLE data type, use the OLE DB .NET Data Provider with MSDAORA.

In This Section

See Also

Other Resources

Using the .NET Framework Data Provider for Oracle