Oracle ODBC connection string parameters

The following table describes the key connection string parameters for connecting to Oracle via the ODBC driver.

Server configuration

Parameter Description
Connect Mode The system privilege used by the user when connecting to the server. The required privilege must be granted to the user beforehand. Available values:
  • Normal – (Default) Connects as a standard user.
  • SysOper – Connects with the SYSOPER privilege.
  • SysDBA – Connects with the SYSDBA privilege.
  • SysASM – Connects with the SYSASM privilege.
  • SysBkp – Connects with the SysBackup privilege.
  • SysDG – Connects with the SysDG privilege.
  • SysKM – Connects with the SYSKM privilege.
Data Source The host name or IP address of the Oracle server.
Direct Enables Direct mode.
Home Name The identifier of the Oracle client installation to use.
Host The host name of the server hosting the Oracle database.
Password The Oracle password.
Port The port number for the connection. The default value is 1521.
Service Name The service name of the Oracle database.
SID The Oracle system identifier of the database instance.
User ID The Oracle username.

Advanced settings

Parameter Description
AllowNullStringsInMetadata Allows metadata retrieval even when some parameters contain NULL values, ensuring compatibility with third-party tools that pass NULL. The default value is True.
AllSchemas Enables the use of all schemas that an Oracle user has been granted privileges on. The default value is False.
Character Set Specifies the character set for the driver to use when reading and writing character data.
Connection Timeout Specifies the time (in seconds) to wait for a connection to open before terminating an attempt. The default value is 0, meaning an attempt to connect continues indefinitely.
Date Type Specifies how the Oracle DATE data type is mapped to an ODBC data type. Available values:
  • Default – Maps Oracle DATE to ODBC SQL_TYPE_TIMESTAMP.
  • Date Only – Maps Oracle DATE to ODBC SQL_TYPE_DATE.
EmptyStringsAsNullInMetadata Converts empty strings to NULL when retrieving data. The default value is True.
IgnoreCommandTimeout Determines whether the driver allows changes to the SQL_ATTR_QUERY_TIMEOUT attribute. If False, the driver permits setting this attribute via the SQLSetStmtAttr and SQLSetConnectAttr functions. If True, the driver ignores any attempt to change the query timeout value and returns an error. The default value is False.
IP Version Specifies the Internet Protocol version to use. Available values:
  • IPv4 – (Default) Uses Internet Protocol version 4 (IPv4).
  • IPv6 – Uses Internet Protocol version 6 (IPv6).
  • IPBoth – Uses either Internet Protocol version 6 (IPv6) or version 4 (IPv4). If IPv6 is enabled in the operating system, a connection is attempted via IPv6. If the connection attempt fails, a new connection attempt is made via IPv4.
MinFetchRows Controls the minimum number of rows the driver fetches from the server during query execution.
  • If the value of the SQL_ATTR_ROW_ARRAY_SIZE attribute is less than MinFetchRows, the driver fetches MinFetchRows rows.
  • If SQL_ATTR_ROW_ARRAY_SIZE is greater than or equal to MinFetchRows, the driver fetches the number of rows specified by SQL_ATTR_ROW_ARRAY_SIZE.
To ensure the driver fetches exactly the number of rows specified by SQL_ATTR_ROW_ARRAY_SIZE, set MinFetchRows to 0.
Note: The default value of SQL_ATTR_ROW_ARRAY_SIZE is 1, which may significantly reduce performance if MinFetchRows is set to 0.
ODBC Behavior Specifies the ODBC specification version the driver must conform to, based on the expectations of a third-party tool.
Typically, the driver’s behavior is controlled by setting the SQL_ATTR_ODBC_VERSION attribute via the SQLSetEnvAttr function. However, some third-party tools expect the driver to behave according to ODBC 2.x standards, but either fail to set this attribute or pass an incorrect value.
In such cases, you can explicitly define the required behavior in the connection string using the ODBC Behavior parameter. Available values:
  • Default – Uses the default behavior as determined by the third-party tool.
  • Ver 2.x – Forces the driver to use ODBC 2.x behavior.
  • Ver 3.x – Forces the driver to use ODBC 3.x behavior.
ReadOnly Specifies whether to prevent data from being modified. The default value is False.
RegionalDateTimeSettings Enables local regional settings for converting dates and times to strings. The default value is False.
RegionalNumberSettings Enables local regional settings for converting numbers to strings. The default value is False.
Schema Specifies the schema of the session to be used instead of the current one.
String Types Specifies the type of string data returned:
  • Default – The driver determines the appropriate string types.
  • Ansi – Returns string data as SQL_CHAR, SQL_VARCHAR, and SQL_LONGVARCHAR.
  • Unicode – Returns string data as SQL_WCHAR, SQL_WVARCHAR, and SQL_WLONGVARCHAR.
Use Unicode Enables Unicode support. The default value is False.

Sample connection string

Connection in Direct mode

  • Using a Service Name.
DRIVER={Devart ODBC Driver for Oracle};Direct=True;Host=myServer;Service Name=myServiceName;User ID=myUsername;Password=myPassword
  • Using a SID (deprecated format).
DRIVER={Devart ODBC Driver for Oracle};Direct=True;Host=myServer;SID=mySID;User ID=myUsername;Password=myPassword

Connection in OCI mode

DRIVER={Devart ODBC Driver for Oracle};Data Source=myServer;Home Name=myHomeName;User ID=myUsername;Password=myPassword