Export (0) Print
Expand All

OracleParameter Class

Represents a parameter to an OracleCommand and optionally its mapping to a DataColumn. This class cannot be inherited.

Namespace:  System.Data.OracleClient
Assembly:  System.Data.OracleClient (in System.Data.OracleClient.dll)

public ref class OracleParameter sealed : public DbParameter, 
	ICloneable, IDbDataParameter, IDataParameter

Parameter names are not case-sensitive.

When querying an Oracle database using the Microsoft OLE DB Provider for Oracle (MSDAORA) and the ODBC.NET Framework Data Provider, using the LIKE clause to query values in fixed-length fields may not return all expected matches. The reason is that when Oracle matches values for fixed-length fields in a LIKE clause, it matches the entire length of the string, including any padding trailing spaces. For example, if a table in an Oracle database contains a field named "Field1" that is defined as char(3), and you enter the value "a" into a row of that table, the following code will not return the row.

No code example is currently available or this language may not be supported.

This is because Oracle stores the column value as "a " (padding "a", with trailing spaces, to the fixed field length of 3), which Oracle does not treat as a match for the parameter value of "a" in the case of a LIKE comparison of fixed-length fields.

To resolve this problem, append a percentage ("%") wildcard character to the parameter value ("a%"), or use an SQL = comparison instead.

The following example creates multiple instances of OracleParameter through the OracleParameterCollection within the OracleDataAdapter. These parameters are used to select data from the database and place the data in the DataSet. This example assumes that a DataSet and an OracleDataAdapter have already been created by using the appropriate schema, commands, and connection.

No code example is currently available or this language may not be supported.

System::Object
  System::MarshalByRefObject
    System.Data.Common::DbParameter
      System.Data.OracleClient::OracleParameter

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1

Community Additions

ADD
Show:
© 2014 Microsoft