Sunteți pe pagina 1din 99

Oracle8 ODBC Driver Help

For All Users


What Is ODBC?
Open Database Connectivity (ODBC) provides a standard interface that allows one
application to access many different data sources. The application's source code does not
have to be recompiled for each data source. A database driver links the application to a
specific data source. A database driver is a dynamic-link library that an application can
invoke on demand to gain access to a particular data source. Therefore, the application can
access any data source for which a database driver exists.
The ODBC interface defines the following:
• A library of ODBC function calls that allows an application to connect to a data source,
execute SQL statements, and retrieve results.
• SQL syntax based on the SQL-99 specification.
• A standard set of error codes.
• A standard way to connect to and log in to a data source.
• A standard representation for data types.
The following figure describes the components of the ODBC model.

See Also: For All Users


What is the Oracle8 ODBC driver?
The Oracle8 ODBC Driver enables ODBC Windows 95, Windows 98, Windows 2000, and
Windows NT X86 applications read and write access to Oracle databases through the ODBC
interface using Net8™ software through which third party network transports such as
Microsoft LAN Manager, Novell NetWare, Banyan VINES, DECnet, or any TCP/IP network
are supported.
The Oracle8 ODBC Driver uses the Oracle Call Interface (OCI) client and server software
to submit requests to and receive responses from the data source. Net8 communications
protocol is used for communications between the OCI client and the Oracle server.
The Oracle8 ODBC Driver translates ODBC SQL syntax into syntax that can be used to
access the data source. When the results are returned from the data source, the Oracle8
ODBC Driver translates them back to ODBC SQL syntax.
The ODBC application/ODBC driver architecture is:

* The Oracle8 ODBC Resource file (sqresxx.dll),


where xx represents the language abbreviation,
contains all pertinent language information and is
shared by this DLL; the default resource file used
is sqresus.dll.
For more information about the OCI client and server software, refer to the OCI
documentation.

See Also: For All Users


Features of Release 8.1.7.1.0
Features of the Oracle8 ODBC Driver Release 8.1.7.1.0 software for the Windows 95,
Windows 98, Windows 2000, and Windows NT X86 operating systems are described as
follows:

SQL_WCHAR Support

When this support is enabled, SQLDescribeCol returns the data type of


SQL_WCHAR for SQL_CHAR columns; SQL_WVARCHAR for SQL_VARCHAR
columns; and SQL_WLONGVARCHAR for SQL_LONGVARCHAR columns.
This feature was added to enable Unicode support in applications which rely on
the results of SQLDescribeCol (for example, ADO). This feature is
enabled/disabled as a Datasource Configuration option. By default, it is disabled.

Support for SQL Server EXEC Syntax

A procedure (or function) call specified in an EXEC statement will be translated


to its equivalent Oracle procedure (or function) call before being processed by
the Oracle8 database server if this feature is enabled. This feature is managed
as a Datasource Configuration option. By default, EXEC Syntax Support is
disabled.

New Setup Dialog Box

The Setup Dialog Box has been re-engineered to more clearly organize the
Datasource Configuration options.

TNS Name Integration

The Datasource Configuration setup now presents the list of TNS names already
defined on the system.

Batch Autocommit Mode

The default behavior for the Oracle8 ODBC Driver is to rollback a transaction if
there is a failure on any row. The default for the Oracle7 ODBC Driver is to
commit up to the row that has a failure. Batch Autocommit Mode was added to
make the Oracle8 ODBC Driver compatible with the Oracle7 ODBC Driver.
There is a third option which directs the ODBC driver to commit all rows which
did not have an error. This third option is available only when connected to an
Oracle8 database. Against earlier databases, this option is identical to the
default Oracle7 behavior. The default remains to rollback the entire transaction.
Features Not Supported
The Oracle8 ODBC Driver does not support the following ODBC 3.0 features:
• Interval data types
• SQL_C_UBIGINT and SQL_C_SBIGINT C data type identifiers
• Binding parameters by name
• Multiple environment handles
• Shared connections
• Shared environments
• The SQL_LOGIN_TIMEOUT attribute of SQLSetConnectAttr
Files Created by the Installation
The following files are installed by the Oracle8 ODBC Driver kit:

Oracle8 ODBC Driver Files

File Name Description


sqora32.dll Oracle8 ODBC Database Access DLL
sqoras32.dll Oracle8 ODBC Driver Setup DLL
sqresus.dll Oracle8 ODBC Resource DLL
oraodbc.ini Oracle8 ODBC Driver initialization file
ODBCRelnotes.wri Oracle8 ODBC Driver release notes
sqora.hlp Oracle8 ODBC Driver for Windows 95, Windows 98,
Windows 2000, and Windows NT X86 help file
sqora.cnt Oracle8 ODBC Driver for Windows 95, Windows 98,
Windows 2000, and Windows NT X86 help contents file
odbctst.exe Oracle8 ODBC Test Utility - this utility is provided to verify
that ODBC connectivity works after an installation.

Microsoft Driver Manager and 32-bit Administrator Files

See the Microsoft ODBC 3.0 Software Development Kit and Programmer’s Reference for
the list of files that are installed with Microsoft’s ODBC 3.0 Components.
Driver Conformance Levels
ODBC defines conformance levels for drivers in two areas:
• ODBC application programming interface (API)
• ODBC SQL-99 syntax.
The Oracle8 ODBC Driver supports all core API functionality and a limited set of Level 1 and
Level 2 functionality. See API conformance for more information.
The Oracle8 ODBC Driver is broadly compatible with the SQL-99 Core specification which is
a superset of the SQL-92 Entry Level specification. Applications should call SQLGetInfo with
the appropriate information type to retrieve a list of SQL-99 supported features.
Configuration Tasks
Configuring Net8 Database Services
Before you configure the data source, you must configure Net8 database services so there is
an entry for each TNS Service Name. To do this, start the Oracle Net8 Assistant by one of
the following methods:
• Click on the Oracle for Windows NT program group and click on the Oracle
Net8 Assistant icon.
Or:
• From the start menu, select Programs, select Oracle for Windows NT, and
select the Oracle Net8 Assistant.
Using the Oracle Net8 Assistant, you can create an entry in the tnsnames.ora file for each
TNS Service Name. The Oracle Net8 Assistant is installed when you install Net8.
Using the Oracle Net8 Assistant, you can create, modify, or delete a TNS Service Name or
its associated network protocol information, and view configuration information. For
example, to create a TNS Service Name, double click on the TNS Service Names folder in
the left hand side screen, then click on the + (Create) icon on the tool bar and follow the
instructions provided in the Oracle Service Names Wizard. Click on the Oracle Net8
Assistant help button for more information. To update configuration information for an
existing service name, open the TNS Service Names folder, double click on the service
name to display its current configuration information in the right hand side panel, edit the
applicable parameters, and save your changes. Once you have created or updated the
configuration information, Net8 is configured and you are ready to configure each data
source.

See Also: For All Users


Configuring the Data Source
After installing the Oracle8 ODBC Driver and Configuring Net8 database services, and
before using the Oracle8 ODBC Driver, you must configure the data source.
Before an application can communicate with the data source, you must provide configuration
information. The configuration information informs the Oracle8 ODBC Driver as to which
information you want to access.
The data source consists of the data that you want to access, its associated operating
system, database management system, and network platform used to access the database
management system. The data source for requests submitted by the Oracle8 ODBC Driver
is an Oracle database and supports transports available under Net8.
After you have installed the Oracle8 ODBC Driver, use the 32-bit Administrator (which is
installed when you install the Oracle8 ODBC Driver) to perform the configuration. Follow
these steps:
1. Either double click on the 32-bit Administrator icon or from the start menu, select
Programs, then depending on the platform select either Oracle for Windows 95,
Oracle for Windows 98, Oracle for Windows 2000, Oracle for Windows NT, or
Oracle - OraHome81 and select the 32-bit Administrator. A list of installed drivers is
displayed.
2. Click on the Add button in the Data Sources window and then click on the Oracle8
ODBC Driver in the list of installed drivers.
3. Click on OK. The Oracle8 ODBC Driver Setup dialog box is displayed. You must
enter the Data Source Name and TNS Service Name. You can provide the other
information requested in the dialog box, or you can leave the fields blank and
provide the information when you run the application.
4. After you have entered the data, click on OK or press Return.

See Also: For All Users


Oracle8 ODBC Setup Dialog Box
You must enter the Data Source Name and the TNS Service Name. You can provide the
other information requested in the dialog box, or you can leave the fields blank and provide
the information when you run the application.
The Oracle8 ODBC Setup dialog box has the following options:

Main Setup Options

Data Source Name - the name used to identify the data source to ODBC. For
example, "Personnel Data".
Description - a description or comment about the data in the data source. For
example, "Hire date, salary history, and current review of all employees."
TNS Service Name - the location of the Oracle database from which the ODBC
driver will retrieve data. This is the same name entered in configuring Net8
database services using the Oracle Net8 Assistant. For more information, see
the Net8 documentation and troubleshooting using the Oracle8 ODBC Driver for
the first time. The TNS Service Name can be selected from a pulldown list of
available TNS names.
User ID - the User ID is the user name of the account on the server used to
access the data.

For additional information on the tabs, click on any of the following options:
Application Options
Oracle Options
Workarounds Options
SQLServer Migration Options
Translation Options
Adding, Modifying, and Deleting Oracle Data Sources
Before you can access data with the Oracle8 ODBC Driver, you must add a data source for
each of your Oracle databases. The Oracle8 ODBC Driver uses the information you enter
when you add the data source to access the data. You can change or delete a data source
at any time.

To add an Oracle data source:

1. In the Oracle for Windows NT/95/98/2000 folder, select the 32-bit Administrator icon
or from the start menu, select Programs, then depending on the platform select
either Oracle for Windows 95, Oracle for Windows 98, Oracle for Windows 2000, or
Oracle for Windows NT, and select the 32-bit Administrator.
2. In the Data Sources dialog box, click on the Add button. The Add Data Source dialog
box is displayed.
3. In the Installed ODBC Drivers list, select Oracle8 ODBC Driver and click on the OK
button. The Oracle8 ODBC Setup dialog box is displayed.
4. In the Oracle8 ODBC Setup dialog box, set the option values as necessary and click
on the OK button. You must enter the Data Source Name and TNS Service Name.
You can provide the other information requested in the dialog box, or you can leave
the fields blank and provide the information when you run the application.

To modify an Oracle data source

1. In the Oracle for Windows NT/95/98/2000 folder, select the 32-bit Administrator icon
or from the start menu, select Programs, then depending on the platform select
either Oracle for Windows 95, Oracle for Windows 98, Oracle for Windows 2000, or
Oracle for Windows NT, and select the 32-bit Administrator.
2. In the Data Sources dialog box, select the data source from the Data Sources list
and click on the Configure button. The Oracle8 ODBC Setup dialog box is displayed.
3. In the Oracle8 ODBC Setup dialog box, modify the option values as necessary and
click on the OK button.

To delete an Oracle data source

1. In the Oracle Windows NT/95/98/2000 folder, select the 32-bit Administrator icon or
from the start menu, select Programs, then depending on the platform select either
Oracle for Windows 95, Oracle for Windows 98, Oracle for Windows 2000, or Oracle
for Windows NT, and select the 32-bit Administrator.
2. In the Data Sources dialog box, select the data source you want to delete from the
Data Sources list.
3. Click on the Remove button, and then click on the Yes button to confirm the
deletion.
See Also: For All Users
Modifying the oraodbc.ini File
Driver Logging
You can enable the Oracle8 ODBC Driver to identify problems with applications. When
logging is enabled, log files are written to the application program's current working directory.
Note that log files can be quite large and can slow down performance. Therefore, enable
logging only when necessary, and disable it when it is no longer needed.
The Oracle8 ODBC Driver installation procedure creates the following section in the
oraodbc.ini file:

[Oracle ODBC Driver Common]


Driver Logging=0
RemoveControlChars=NO
LockTimeOut=0

A value of 0 for logging indicates that Oracle8 ODBC Driver logging is turned off.
To enable Oracle8 ODBC Driver logging, insert a valid Oracle8 ODBC Driver logging value
plus 1 after the equal sign, as shown in the following example:

[Oracle ODBC Driver Common]


Driver Logging=7

Valid Oracle8 ODBC Driver logging values are shown in the Driver Logging Values table. To
enable more than one type of logging, add the logging values and then add 1, as shown in
the Driver Logging Values table. For example, to log ODBC entry points (a value of 2) and
main functions (a value of 4), insert a value of 7 (2 + 4 + 1) after the equal sign.
The driver log is written to the file oraodbc.log in the application program's current working
directory.

Driver Logging Values

Value Value + 1 Description


0 - Disable logging
2 3 Log ODBC entry points
4 5 Log main functions
6 7 Log ODBC entry points and main functions
8 9 Log ODBC utility functions
10 11 Log ODBC entry points and utility functions
12 13 Log ODBC main functions and utility functions
14 15 Log ODBC entry points, main functions, and utility functions
16 17 Log only SQL statements and errors
A value of 17 is usually the best Oracle8 ODBC Driver logging value to start with initially for
problem solving because it produces a small amount of output and only logs the SQL
statements sent to the server and any errors that are returned from the server. This logging
value will generally record 90% of the errors that applications encounter.
Reducing Lock Timeout
An Oracle server waits indefinitely for lock conflicts between transactions to be resolved.
You can limit the amount of time that an Oracle server waits for locks to be resolved by
setting the Oracle8 ODBC Driver’s LockTimeOut entry in the oraodbc.ini file. The value you
enter for the LockTimeOut parameter is the number of seconds after which an Oracle server
will time out if it cannot obtain the requested locks. In the following example, the Oracle
server will time out after 60 seconds:

[Oracle ODBC Driver Common]


Driver Logging=0
RemoveControlChars=NO
LockTimeOut=60
Removing Control Characters from SQL Statements
Certain ODBC applications issue SQL statements that contain control characters, such as
carriage returns, which the SQL interface for the Oracle database does not allow. If you are
using such an application, change the value of the RemoveControlChars entry in the driver's
section of the oraodbc.ini file from NO to YES, for example:

[Oracle ODBC Driver Common]


RemoveControlChars=NO
Connecting to a Data Source
Connecting to an Oracle Data Source
To connect to a data source, the Oracle8 ODBC Driver requires that the OCI client software
be installed on your computer and the corresponding listener be running on the Oracle
server. Net8 for Windows NT/95/98/2000 is a Dynamic Linked Library (DLL) based
application. For more information about Net8, see the Net8 documentation.
As part of the connection process, an application can prompt you for information. If an
application prompts you for information about an Oracle data source, do the following:
1. In the TNS Service Name box, enter the name of the TNS service.
2. In the User Name box, enter the name you use to access an Oracle database.
3. In the Password box, enter the password you use to access an Oracle database.
4. Click on the OK button.
An application must connect to a data source in order to access the data in it. Different
applications connect to data sources at different times. For example, an application might
connect to a data source only at your request, or it might connect automatically when it
starts. For information about when an application connects to a data source, see the
documentation for that application.

See Also: For All Users


See Also: For Advanced Users
See Also: For Programmers
Troubleshooting
Using the Oracle8 ODBC Driver for the First Time
The following problems may occur when you use the Oracle8 ODBC Driver for the first time
and attempt to attach to a database or table:

Your PC or server system is missing required software

Problem: Oracle8 ODBC Driver fails to work.


Cause: Either OCI software is not installed on your PC or Oracle database
software is not installed on your server system.
Recommended Action: Install the required OCI software on your client PC or
Oracle database software on your server system or both.

Client/Server connectivity is incorrectly set up on your PC

Problem: Cannot connect to the server system from your PC.


Cause: Either the required transport software is not installed or is not configured
correctly.
Recommended Action: As a test, for example when using TCP/IP, make sure
that your PC can ping to the server where the Oracle database resides. Use
tnsping.exe located in the \orant\bin or \Oracle\ora81\bin directory to ensure
connectivity to a specific database service. For example:

C:\ORANT\BIN>tnsping database-service-name

User cannot connect using an Oracle7 ODBC data source

Problem: An attempt to connect using an Oracle7 ODBC data source returns a


connect error message.
Cause: Oracle7 ODBC data sources are not compatible with Oracle8 ODBC
data sources.
Recommended Action: Create and use an Oracle8 ODBC data source.

TNS Service Name does not match the name that was entered in the Oracle
Net8 Assistant

Problem: The user is returned an error message about the TNS Service Name
while attempting to set up the Oracle8 ODBC Driver.
Cause: The TNS Service Name does not match the name entered in the Oracle
Net8 Assistant.
Recommended Action: Change the TNS Service Name in the Oracle8 ODBC
Driver setup window to match the TNS Service Name in the Oracle Net8
Assistant.
Note: Refer to the pull-down menu on the Datasource Configuration screen to
view a list of all valid TNS service names on the system as well as names
entered by users.

User does not have access to the database

Problem: The user is returned an access denied error message when


attempting to gain access to an Oracle database while using the Oracle8 ODBC
Driver.
Cause: The user does not have access to an Oracle database.
Recommended Action: Ensure the proper privileges are assigned for the user
to gain access to the Oracle database.
Expired Password

Expired Password Behavior Change

In versions of the Oracle8 ODBC Driver previous to release 8.1.6.0.0, when you try to
connect to the database and your password has expired, the Oracle8 ODBC Driver returns
an error condition that indicates that your password has expired. Beginning with release
8.1.6.0.0 of the Oracle8 ODBC Driver, if you try to connect to the database and your
password has expired, you are prompted to change your password. Upon making a
successful password change, you will be connected to the database. However, if you try to
connect to the database with a SQLDriverConnect call with a SQL_DRIVER_NOPROMPT
parameter value, the Oracle8 ODBC Driver will not prompt you for the password change.
Instead, an error condition results, producing an error message and number that indicates
that the password has expired.
For Advanced Users
TNS Service Names for the Oracle8 ODBC Driver
(Advanced)
The TNS Service Name for the Oracle8 ODBC Driver uses the following keywords:

Keyword Description
DSN The name of the data source.
DBQ The TNS Service Name. See Oracle TNS Service Name. For more
information, see the Net8 documentation.
UID The user login ID or user name.
PWD The user-specified password.
For example, to connect to the Human Resources data source on the server HRSRVR using
the Oracle8 ODBC Driver, the login ID Smith, and the password Sesame, you would use the
following TNS Service Name:

DSN=Human Resources;DBQ=HRSRVR;UID=Smith;PWD=Sesame

See Also: For All Users


See Also: For Programmers
Creating Oracle8 ODBC Driver TNS Service Names
with Net8
To create Oracle8 ODBC Driver TNS Service Names with Net8, use the Oracle Net8
Assistant, which is installed when you install Net8. The Oracle Net8 Assistant creates
Oracle8 ODBC Driver TNS Service Name entries in the tnsnames.ora file.
SQL Statements (Advanced)
The Oracle8 ODBC Driver is broadly compatible with the SQL-99 Core specification which is
a superset of the SQL-92 Entry Level specification. In addition to Oracle's grammar, the
vendor-specific escape sequences outlined in Appendix C of the ODBC specifications are
also supported. In accordance with the design of ODBC, the Oracle8 ODBC Driver will pass
native SQL syntax to the Oracle database.
The following Help topic describes the SQL syntax implemented by the Oracle8 ODBC
Driver:
For Programmers
Implementation of the ODBC SQL Syntax (Programming)

See Also: For Advanced Users


Data Types (Advanced)
The Oracle8 ODBC Driver maps Oracle database data types to ODBC SQL data types.
Note: All conversions in Appendix D of the Microsoft ODBC 3.0 Software
Development Kit and Programmer's Reference are supported for the ODBC
SQL data types listed from a call to SQLGetInfo with the appropriate information
type.

The following Help topics describe the data types implemented by the Oracle8 ODBC Driver:
For Advanced Users
Implementation of Data Types (Advanced)
Limitations on Data Types (Advanced)

For Programmers
Implementation of Data Types (Programming)

See Also: For Advanced Users


Implementation of Data Types (Advanced)
The DATE data type in an Oracle database has both date and time parts. In the native SQL
used by the Oracle database, the time portion of a DATE column is not returned unless a
query specifically requests it. However, because the Oracle8 ODBC Driver maps the DATE
data type to the SQL_TIMESTAMP data type, the driver always returns both the date and
time portions of a DATE column.
Limitations on Data Types (Advanced)
The Oracle8 ODBC Driver and the Oracle database impose the following limitations on the
data types:

Limited Data Type Description


Literals Oracle database limits literals in SQL statements to
4000 bytes.

SQL_LONGVARCHAR Oracle's limit for SQL_LONGVARCHAR data where


and the column type is LONG is 2,147,483,647 bytes.
SQL_WLONGVARCHAR Oracle’s limit for the SQL_LONGVARCHAR data
where the column type is CLOB is 4 gigabytes. The
limiting factor is the client workstation memory.

SQL_LONGVARCHAR Oracle database allows only a single long data column


and per table. The long data types are
SQL_LONGVARBINARY SQL_LONGVARCHAR (LONG) and
SQL_LONGVARBINARY (LONG RAW). Oracle
recommends you use CLOB and BLOB columns
instead. There is no restriction on the number of CLOB
and BLOB columns in a table.
Error Messages (Advanced)
When an error occurs, the Oracle8 ODBC Driver returns the native error number, the
SQLSTATE (an ODBC error code), and an error message. The driver derives this
information both from errors detected by the driver and errors returned by the Oracle server.

Native Error

For errors that occur in the data source, the Oracle8 ODBC Driver returns the native error
returned to it by the Oracle server. When the Oracle8 ODBC Driver or the Driver Manager
detects an error, the Oracle8 ODBC Driver returns a native error of zero.

SQLSTATE

For errors that occur in the data source, the Oracle8 ODBC Driver maps the returned native
error to the appropriate SQLSTATE. When the Oracle8 ODBC Driver detects an error, it
generates the appropriate SQLSTATE. When the Driver Manager detects an error, it
generates the appropriate SQLSTATE.

Error Message

For errors that occur in the data source, the Oracle8 ODBC Driver returns an error message
based on the message returned by the Oracle server. For errors that occur in the Oracle8
ODBC Driver or the Driver Manager, the Oracle8 ODBC Driver returns an error message
based on the text associated with the SQLSTATE.
Error messages have the following format:

[vendor] [ODBC-component] [data-source] error-message

The prefixes in brackets ( [ ] ) identify the source of the error. The following table shows the
values of these prefixes returned by the Oracle8 ODBC Driver. When the error occurs in the
data source, the [vendor] and [ODBC-component] prefixes identify the vendor and name of
the ODBC component that received the error from the data source.

Error source Prefix Value


Driver Manager [vendor] [Microsoft]
[ODBC-component] [ODBC DLL]
[data-source] N/A
Oracle8 ODBC [vendor] [ORACLE]
Driver [ODBC-component] [ODBC Oracle8 ODBC Driver]
[data-source] N/A
Oracle server [vendor] [ORACLE]
[ODBC-component] [ODBC Oracle8 ODBC Driver]
[data-source] [Oracle OCI]
For example, if the error message does not contain the [Ora] prefix shown in the following
format, the error is an Oracle8 ODBC Driver error and should be self-explanatory.
[Oracle][ODBC]Error message text here

If the error message contains the [Ora] prefix shown in the following format, it is not an
Oracle8 ODBC Driver error. Note that although the error message contains the [Ora] prefix,
the actual error may be coming from one of several sources.

[Oracle][ODBC][Ora]Error message text here

If the error message text starts with the following prefix, you can obtain more information
about the error in the Oracle server documentation.

ORA-

Net8 errors and Trace logging are located under the Net80 directory where the OCI software
is installed. Database logging is located under the Rdbmsxx directory where xx represents
the release version for where the Oracle server software is installed (for example, the
Rdbms80 directory where the Oracle8 server software is installed).
See the Oracle server documentation for more information about server error messages.
For Programmers
Format of the Connection String (Programming)
The following list of keywords can be included in the connection string argument of the
SQLDriverConnect function call. Missing keywords will be read from the 32-bit Administrator
entry for the data source. Values specified in the connection string will override those
contained in the 32-bit Administrator entry. See the Microsoft ODBC 3.0 Software
Development Kit and Programmer's Reference for more information about the
SQLDriverConnect function.

Keyword Meaning Values


(bold text denotes the default value)

DSN= ODBC Data Source Name User-supplied name.


DBQ= TNS Service Name User-supplied name.
UID= User ID or User Name User-supplied name.
PWD= Password User-supplied password.
Specify PWD=; for an empty password.
DBA= Database Attribute W=write access.
R=read-only access.
APA= Applications Attributes T=Thread Safety Enabled.
F=Thread Safety Disabled.
RST= Result Sets T=Result Sets Enabled.
F=Result Sets Disabled.
QTO= Query Timeout Option T=Query Timeout Enabled.
F=Query Timeout Disabled.
CSR= Close Cursor Enabled T=Close Cursor Enabled.
F=Close Cursor Disabled.
BAM Batch Autocommit Mode IfAllSuccessful=Comit only if all statements
are successful (old behavior)
UpToFirstFailure=Commit up to first failing
statement (V7 ODBC behavior)
AllSuccessful=Commit all successful
statements (only when connected to an
Oracle8 database; against other databases,
same behavior as V7.)
PFC= Prefetch Count User-supplied numeric value (specify a value
of 0 or greater).
The default is 10.
FEN= Failover Enabled T=Failover Enabled.
F=Failover Disabled.
FRC= Failover Retry Count User-supplied numeric value.
The default is 10.
FDL= Failover Delay User-supplied numeric value.
The default is 10.
LOB= LOB Writes Enabled T=LOBs Enabled.
F=LOBs Disabled.
FRL= Force Retrieval of Oracle T=Forced Long Reads Enabled.
Long Column F=Forced Long Reads Disabled.
MTS= Microsoft Transaction Server T=Disabled.
Support F=Enabled.
FWC= Force SQL_WCHAR Support T=Force SQL_WCHAR Enabled.
F=Force SQL_WCHAR Disabled.
EXC= EXEC Syntax Enabled T=EXEC Syntax Enabled
F=EXEC Syntax Disabled
XSM= Schema Field Default=Default
Database=Database Name
Owner=Owner Name
TLO= Translation Option User-supplied numeric value.
The default is 0.
TLL= Translation Library Name User-supplied name.

If the following keyword is specified in the connection string, the Oracle8 ODBC Driver will
not read any values defined from the 32-bit Administrator:

DRIVER={Oracle ODBC Driver}

Examples of valid connection strings are:

1) DSN=Personnel;UID=Kotzwinkle;PWD=;
2) DRIVER={Oracle ODBC
Driver};UID=Kotzwinkle;PWD=whatever;DBQ=instl_alias;DBA=W;
SQLDriverConnect Implementation (Programming)
The SQLDriverConnect connection string requires only the following keywords:

Keyword Description
DSN The name of the data source.
DBQ The TNS Service Name. See TNS Service Name. For more information,
see the Net8 documentation.
UID The user login ID or user name.
PWD The user-specified password.
Reducing Lock Timeout in a Program (Programming)
The Oracle server waits indefinitely for lock conflicts between transactions to be resolved.
You can limit the amount of time that the Oracle server waits for locks to be resolved by
calling the ODBC SQLSetConnectAttr function before connecting to the data source. Specify
a nonzero value for the SQL_ATTR_QUERY_TIMEOUT attribute in the ODBC
SQLSetStmtAttr function.
If you specify a lock timeout value using the ODBC SQLSetConnectAttr function, it overrides
any value specified in the oraodbc.ini file. Refer to the Reducing Lock Timeout topic for
more information on specifying a value in the oraodbc.ini file.
Linking with odbc32.lib (Programming)
When you link your program, you must link it with the import library odbc32.lib.
Improving Concurrency and Performance
(Programming)
To improve concurrency and performance of your application, perform the following:
• Set the SQL_ATTR_AUTOCOMMIT attribute of the ODBC SQLSetConnectAttr function
to off, and perform manual commit or rollback operations using the ODBC SQLEndTran
function.
• If you are performing transactions that do not update the data source, set the
SQL_ATTR_ACCESS_MODE attribute of the ODBC SQLSetConnectAttr function to
SQL_MODE_READ_ONLY.
• If you are not using ODBC escape clauses, set the SQL_ATTR_NOSCAN attribute of the
ODBC SQLSetConnectAttr function or the ODBC SQLSetStmtAttr function to true.
• Use the ODBC SQLFetchScroll function instead of the ODBC SQLFetch function for
retrieving data from tables that have a large number of rows.
• Set the Prefetch Count for Oracle Options in the Oracle8 ODBC Setup dialog box to a
value greater than 1. Increasing this value instructs the server to return multiple rows in
a single fetch operation to the client’s cache, thus improving performance for
applications designed to return groups of adjacent rows to users. Choose a value that
works best for your application. See the Oracle8 ODBC Setup Dialog Box topic for more
information.
• Set the Enable Thread Safety for Applications Options in the Oracle8 ODBC Setup
dialog box to disable if your application does not use threads. In this case, there is no
need to incur the overhead associated with making the Oracle8 ODBC Driver thread
safe.
• Set the Enable LOBs for Oracle Options in the Oracle8 ODBC Setup dialog box to
disable if your application does not update Oracle LOBs. There is a small performance
penalty for INSERT and UPDATE statements when LOBs are enabled.
• Set the Enable Result Sets for Application Options in the Oracle8 ODBC Setup dialog
box to disable if your application does not use Result Sets. There is a small performance
penalty for procedures called from packages not containing Result Sets.
• Set the Force Retrieval of Long Columns for Workarounds Options in the Oracle8 ODBC
Setup dialog box to disable if your application does need to perform another operation
before it has completed reading the entire long column. This will save on client memory
consumption.
• Set the Enable Closing Cursors for Application Options in the Oracle8 ODBC Setup
dialog box to disable if it is not necessary for the database server to immediately close
the cursor. There is a small performance penalty to force the server to close the cursor.
Obtaining Information About rowids (Programming)
The ODBC SQLSpecialColumns function returns information about the columns in a table.
When used with the Oracle8 ODBC Driver, it returns information about the Oracle rowids
associated with an Oracle table.
Rowids in a WHERE Clause (Programming)
Rowids may be used in the WHERE clause of an SQL statement. However, the rowid value
must be presented in a parameter marker.
Enabling Result Sets (Programming)
Oracle reference cursors (Result Sets) allow an application to retrieve data using stored
procedures and stored functions. The following information identifies how to use reference
cursors to enable Result Sets through ODBC.
• The ODBC syntax for calling stored procedures must be used. Native PL/SQL is not
supported through ODBC. The following identifies how to call the procedure or function
without a package and within a package. The package name in this case is RSET.

Procedure call:
{CALL Example1(?)}
{CALL RSET.Example1(?)}
Function Call:
{? = CALL Example1(?)}
{? = CALL RSET.Example1(?)}
• The PL/SQL reference cursor parameters may be omitted when calling the procedure,
however, if one reference cursor parameter is specified, all must be specified. For
example, assume procedure Example2 is defined to have four parameters. Parameters
1 and 3 are reference cursor parameters and parameters 2 and 4 are character strings.
The call can be specified in the following two ways:

{CALL RSET.Example2("Literal 1", "Literal 2")}

In the following example, parameters 1 and 3 contain reference cursor parameters.

{CALL RSET.Example2(?,"Literal 1", ?,"Literal 2")}


Note: In versions of the Oracle8 ODBC Driver previous to release 8.1.5.3.0,
each reference cursor parameter for a procedure or function had to contain
parameter marker(s) on the call statement. The reference cursor parameter(s)
did not need to be bounded by the calling application. If the calling application
did bind the parameter, the Oracle8 ODBC Driver ignored it and bound the
reference cursor parameter(s) internally.

The following example application shows how to return a Result Set using the Oracle8
ODBC Driver:
/*
* Sample Application using Oracle reference cursors via ODBC
*
* Assumptions:
*
* 1) Oracle Sample database is present with data loaded for the EMP table.
*
* 2) Two fields are referenced from the EMP table ename and mgr.
*
* 3) A data source has been setup to access the sample database.
*
*
* Program Description:
*
* Abstract:
*
* This program demonstrates how to return result sets using
* Oracle stored procedures
*
* Details:
*
* This program:
* Creates an ODBC connection to the database.
* Creates a Packaged Procedure containing two result sets .
* Executes the procedure and retrieves the data from both result sets .
* Displays the data to the user.
* Deletes the package then logs the user out of the database.
*
*
* The following is the actual PL/SQL this code generates to
* create the stored procedures.
*
DROP PACKAGE ODBCRefCur;
CREATE PACKAGE ODBCRefCur AS
TYPE ename_cur IS REF CURSOR;
TYPE mgr_cur IS REF CURSOR;
PROCEDURE EmpCurs(Ename IN OUT ename_cur, Mgr IN OUT mgr_cur, pjob IN VARCHAR2);

END;
/
CREATE PACKAGE BODY ODBCRefCur AS
PROCEDURE EmpCurs(Ename IN OUT ename_cur, Mgr IN OUT mgr_cur, pjob IN VARCHAR2)
AS
BEGIN
IF NOT Ename%ISOPEN
THEN
OPEN Ename for SELECT ename from emp;
END IF;

IF NOT Mgr%ISOPEN
THEN
OPEN Mgr for SELECT mgr from emp where job = pjob;
END IF;
END;
END;
/

*
* End PL/SQL for Reference Cursor.
*/

/*
* Include Files
*/
#include <windows.h>
#include <stdio.h>
#include <sql.h>
#include <sqlext.h>

/*
* Defines
*/
#define JOB_LEN 9
#define DATA_LEN 100
#define SQL_STMT_LEN 500

/*
* Procedures
*/
void DisplayError( SWORD HandleType, SQLHANDLE hHandle, char *Module );

/*
* Main Program
*/
int main()
{
SQLHENV hEnv;
SQLHDBC hDbc;
SQLHSTMT hStmt;
SQLRETURN rc;
char *DefUserName ="scott";
char *DefPassWord ="tiger";
SQLCHAR ServerName[DATA_LEN];
SQLCHAR *pServerName=ServerName;
SQLCHAR UserName[DATA_LEN];
SQLCHAR *pUserName=UserName;
SQLCHAR PassWord[DATA_LEN];
SQLCHAR *pPassWord=PassWord;
char Data[DATA_LEN];
SQLINTEGER DataLen;
char error[DATA_LEN];
char *charptr;
SQLCHAR SqlStmt[SQL_STMT_LEN];
SQLCHAR *pSqlStmt=SqlStmt;
char *pSalesMan = "SALESMAN";
SQLINTEGER sqlnts=SQL_NTS;

/*
* Allocate the Environment Handle
*/
rc = SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HANDLE, & hEnv );
if (rc != SQL_SUCCESS)
{
printf( "Cannot Allocate Environment Handle\n");
printf( "\nHit Return to Exit\n");
charptr = gets ((char *)error);
exit(1);
}

/*
* Set the ODBC Version
*/
rc = SQLSetEnvAttr( hEnv,
SQL_ATTR_ODBC_VERSION,
(void *)SQL_OV_ODBC3,
0);
if (rc != SQL_SUCCESS)
{
printf( "Cannot Set ODBC Version\n");
printf( "\nHit Return to Exit\n");
charptr = gets ((char *)error);
exit(1);
}

/*
* Allocate the Connection handle
*/
rc = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
if (rc != SQL_SUCCESS)
{
printf( "Cannot Allocate Connection Handle\n");
printf( "\nHit Return to Exit\n");
charptr = gets ((char *)error);
exit(1);
}

/*
* Get User Information
*/
lstrcpy( (char *) pUserName, DefUserName );
lstrcpy( (char *) pPassWord, DefPassWord );

/*
* Data Source name
*/
printf( "\nEnter the ODBC Data Source Name\n" );
charptr = gets ((char *) ServerName);

/*
* User Name
*/
printf ( "\nEnter User Name Default [%s]\n", pUserName);
charptr = gets ((char *) UserName);
if (*charptr == '\0')
{
lstrcpy( (char *) pUserName, (char *) DefUserName );
}

/*
* Password
*/
printf ( "\nEnter Password Default [%s]\n", pPassWord);
charptr = gets ((char *) PassWord);
if (*charptr == '\0')
{
lstrcpy( (char *) pPassWord, (char *) DefPassWord );
}

/*
* Connection to the database
*/
rc = SQLConnect( hDbc,
pServerName,
(SQLSMALLINT) lstrlen((char *)pServerName),
pUserName,
(SQLSMALLINT) lstrlen((char *)pUserName),
pPassWord,
(SQLSMALLINT) lstrlen((char *)pPassWord));
if (rc != SQL_SUCCESS)
{
DisplayError(SQL_HANDLE_DBC, hDbc, "SQLConnect");
}

/*
* Allocate a Statement
*/
rc = SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt );
if (rc != SQL_SUCCESS)
{
printf( "Cannot Allocate Statement Handle\n");
printf( "\nHit Return to Exit\n");
charptr = gets ((char *)error);
exit(1);
}

/*
* Drop the Package
*/
lstrcpy( (char *) pSqlStmt, "DROP PACKAGE ODBCRefCur");
rc = SQLExecDirect(hStmt, pSqlStmt, lstrlen((char *)pSqlStmt));

/*
* Create the Package Header
*/
lstrcpy( (char *) pSqlStmt, "CREATE PACKAGE ODBCRefCur AS\n");
lstrcat( (char *) pSqlStmt, " TYPE ename_cur IS REF CURSOR;\n");
lstrcat( (char *) pSqlStmt, " TYPE mgr_cur IS REF CURSOR;\n\n");
lstrcat( (char *) pSqlStmt, " PROCEDURE EmpCurs (Ename IN OUT ename_cur,");
lstrcat( (char *) pSqlStmt, "Mgr IN OUT mgr_cur,pjob IN VARCHAR2);\ n\n");
lstrcat( (char *) pSqlStmt, "END;\n");
rc = SQLExecDirect(hStmt, pSqlStmt, lstrlen((char *)pSqlStmt));
if (rc != SQL_SUCCESS)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLExecDirect");
}

/*
* Create the Package Body
*/
lstrcpy( (char *) pSqlStmt, "CREATE PACKAGE BODY ODBCRefCur AS\n");
lstrcat( (char *) pSqlStmt, " PROCEDURE EmpCurs (Ename IN OUT ename_cur,");
lstrcat( (char *) pSqlStmt, "Mgr IN OUT mgr_cur, pjob IN VARCHAR2)\n AS\n
BEGIN\n");
lstrcat( (char *) pSqlStmt, " IF NOT Ename%ISOPEN\n THEN\n");
lstrcat( (char *) pSqlStmt, " OPEN Ename for SELECT ename from
emp;\n");
lstrcat( (char *) pSqlStmt, " END IF;\n\n");
lstrcat( (char *) pSqlStmt, " IF NOT Mgr%ISOPEN\n THEN\n");
lstrcat( (char *) pSqlStmt, " OPEN Mgr for SELECT mgr from emp where
job = pjob;\n");
lstrcat( (char *) pSqlStmt, " END IF;\n");
lstrcat( (char *) pSqlStmt, " END;\n");
lstrcat( (char *) pSqlStmt, "END;\n");
rc = SQLExecDirect(hStmt, pSqlStmt, lstrlen((char *)pSqlStmt));
if (rc != SQL_SUCCESS)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLExecDirect");
}

/*
* Bind the Parameter
*/
rc = SQLBindParameter(hStmt,
1,
SQL_PARAM_INPUT,
SQL_C_CHAR,
SQL_CHAR,
JOB_LEN,
0,
pSalesMan,
0,
& sqlnts);

/*
* Call the Store Procedure which executes the Result Sets
*/
lstrcpy( (char *) pSqlStmt, "{CALL ODBCRefCur.EmpCurs(?)}");
rc = SQLExecDirect(hStmt, pSqlStmt, lstrlen((char *)pSqlStmt));
if (rc != SQL_SUCCESS)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLExecDirect");
}

/*
* Bind the Data
*/
rc = SQLBindCol( hStmt,
1,
SQL_C_CHAR,
Data,
sizeof(Data),
& DataLen);
if (rc != SQL_SUCCESS)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLBindCol");
}

/*
* Get the data for Result Set 1
*/
printf( "\nEmployee Names\n\n");
while ( rc == SQL_SUCCESS )
{
rc = SQLFetch( hStmt );
if ( rc == SQL_SUCCESS )
{
printf("%s\n", Data);
}
else
{
if (rc != SQL_NO_DATA)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLFetch");
}
}
}

printf( "\nFirst Result Set - Hit Return to Continue\n");


charptr = gets ((char *)error);

/*
* Get the Next Result Set
*/
rc = SQLMoreResults( hStmt );
if (rc != SQL_SUCCESS)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLMoreResults");
}

/*
* Get the data for Result Set 2
*/
printf( "\nManagers\n\n");
while ( rc == SQL_SUCCESS )
{
rc = SQLFetch( hStmt );
if ( rc == SQL_SUCCESS )
{
printf("%s\n", Data);
}
else
{
if (rc != SQL_NO_DATA)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLFetch");
}
}
}

printf( "\nSecond Result Set - Hit Return to Continue\n");


charptr = gets ((char *)error);

/*
* Should Be No More Results Sets
*/
rc = SQLMoreResults( hStmt );
if (rc != SQL_NO_DATA)
{
DisplayError(SQL_HANDLE_STMT, hStmt, "SQLMoreResults");
}

/*
* Drop the Package
*/
lstrcpy( (char *) pSqlStmt, "DROP PACKAGE ODBCRefCur");
rc = SQLExecDirect(hStmt, pSqlStmt, lstrlen((char *)pSqlStmt));

/*
* Free handles close connections to the database
*/
SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
SQLDisconnect( hDbc );
SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
SQLFreeHandle( SQL_HANDLE_ENV, hEnv );

printf( "\nAll Done - Hit Return to Exit\n");


charptr = gets ((char *)error);
return(0);
}

/*
* Display Error Messages
*/
void DisplayError( SWORD HandleType, SQLHANDLE hHandle, char *Module )
{

SQLCHAR MessageText[255];
SQLCHAR SQLState[80];
SQLRETURN rc=SQL_SUCCESS;
LONG NativeError;
SWORD RetLen;
SQLCHAR error[25];
char *charptr;

rc = SQLGetDiagRec(HandleType,
hHandle,
1,
SQLState,
& NativeError,
MessageText,
255,
& RetLen);

printf( "Failure Calling % s\n", Module );


if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO)
{
printf( "\t\t\t State: % s\n", SQLState);
printf( "\t\t\t Native Error: % d\n", NativeError );
printf( "\t\t\t Error Message: % s\n", MessageText );
}

printf( "\nHit Return to Exit\n");


charptr = gets ((char *)error);

exit(1);
}
Enabling EXEC Syntax (Programming)
If the syntax of your SQL Server EXEC statement can be readily translated to an equivalent
Oracle procedure call without requiring any change to it, the Oracle8 ODBC Driver can
translate it if you enable this option.
The complete name of a SQL Server procedure consists of up to four identifiers:
• server name
• database name
• owner name
• procedure name
The format for the name is:

[[[server.][database].][ owner_name].]procedure_name

During the migration of the SQL Server database to Oracle8, the definition of each SQL
Server procedure (or function) is converted to its equivalent Oracle syntax and is defined in
a schema in Oracle8. Migrated procedures are often reorganized (and created in schemas)
in one of the three following ways:
• All procedures are migrated to one schema (the default option).
• All procedures defined in one SQL Server database are migrated to the schema named
with that database name.
• All procedures owned by one user are migrated to the schema named with that user's
name.
To support these three ways of organizing migrated procedures, you may specify one of
these schema name options for translating procedure names. Object names in the
translated Oracle procedure call are not case-sensitive.
Unicode Support

Unicode Support within the ODBC Environment

The Microsoft ODBC Driver Manager (Driver Manager) makes all ODBC drivers, regardless
if they support Unicode, appear as if they are Unicode compliant. This allows ODBC
applications to be written independent of the Unicode capabilities of underlying ODBC
drivers.
The extent to which the Driver Manager can emulate Unicode support for ANSI ODBC
drivers is limited by the conversions possible between the Unicode data and the local code
page. Data loss is possible when the Driver Manager is converting from Unicode to the local
code page. Full Unicode support is not possible unless the underlying ODBC driver supports
Unicode.

Unicode Support in ODBC API

The ODBC API supports both Unicode and ANSI entry points using the “W”and “A”suffix
convention. An ODBC application developer does not need to explicitly call entry points with
the suffix. An ODBC application that is compiled with the UNICODE and _UNICODE
preprocessor definitions will generate the appropriate calls. For example, a call to
SQLPrepare will be compiled as SQLPrepareW.
The C data type, SQL_C_WCHAR, was added to the ODBC interface to allow applications to
specify that an input parameter is encoded as Unicode or to request column data returned as
Unicode. The macro SQL_C_TCHAR is useful for applications that need to be built as both
Unicode and ANSI. The SQL_C_TCHAR macro compiles as SQL_C_WCHAR for Unicode
applications and as SQL_C_CHAR for ANSI applications.
The SQL data types, SQL_WCHAR, SQL_WVARCHAR, and SQL_WLONGVARCHAR,
were added to the ODBC interface to represent columns defined in a table as Unicode.
These values are potentially returned from calls to SQLDescribeCol, SQLColAttribute, and
SQLColAttributes. The Oracle database does not support encoding columns as Unicode, so
these values would not be returned from the Oracle8 ODBC Driver.

Unicode Functions in the Microsoft Driver Manager

The Driver Manager performs the following functions when it detects that the underlying
ODBC driver does not support Unicode:
• Convert Unicode function calls to ANSI function calls before calling the ANSI ODBC
driver. String arguments will be converted from Unicode to the local code page. For
example, a call to SQLPrepareW is converted to call SQLPrepare. The text of the SQL
statement parameter is converted from Unicode to the local code page.
• Convert return parameters that are character data from the local code page to Unicode.
For example, returning the column name through SQLColAttribute.
• Convert data from the local code page to Unicode for columns bound as
SQL_C_WCHAR.
• Convert data from Unicode to the local code page for input parameters bound as
SQL_C_WCHAR.

Unicode Support in the Oracle8 ODBC Driver

Unicode support was introduced in version 8.1.5.5.0 of the Oracle8 ODBC Driver. The
Unicode capabilities of the Oracle8 ODBC Driver are dependent on the Unicode features
available through the Oracle Call Interface (OCI 8.1.5.3.0 or higher).
Unicode support within the OCI 8.1.n interface is limited to input parameter
(SQLBindParameter) and column data (SQLBindCol, SQLGetData). Text strings such as
SQL statements, column attributes, and error messages are not handled as Unicode through
the OCI interface. Therefore, the Oracle8 ODBC Driver performs conversions between
Unicode and the local code page for these parameters.

SQLGetData Performance

The SQLGetData function allows an ODBC application to specify the data type to receive a
column as after the data has been fetched. OCI requires the Oracle8 ODBC Driver to
specify the data type before it is fetched. In this case, the Oracle8 ODBC Driver uses the
knowledge it has about the data type of the column as defined in the database to determine
how to best default to fetching the column through OCI.
If a column that contains character data is not bound by SQLBindCol, the Oracle8 ODBC
Driver needs to determine if it should fetch the column as Unicode or as the local code page.
The driver could always default to receiving the column as Unicode, however, this may result
in as many as two unnecessary conversions. For example, if the data were encoded in the
database as ANSI, there would be an ANSI to Unicode conversion to fetch the data into the
Oracle8 ODBC Driver. If the ODBC application then requested the data as SQL_C_CHAR,
there would be an additional conversion to revert the data back to its original encoding.
The Oracle8 ODBC Driver minimizes conversions by comparing the character sets of the
client and database. The Oracle8 ODBC Driver will only default to fetching the data as
Unicode if the two character sets are different.

Unicode Samples

As the Oracle8 ODBC Driver itself was implemented using TCHAR macros, it is
recommended that ODBC application programs use TCHAR in order to take advantage of
the driver.
The following programs are examples showing how to use TCHAR, which becomes the
WCHAR data type in case you compile with UNICODE and _UNICODE.
• List 1: Connection to Database
• List 2: Simple Retrieval
• List 3: Retrieval Using SQLGetData (Binding After Fetch)
• List 4: Simple Update
• List 5: Update and Retrieval for Long Data(CLOB)
List 1: Connection to Database

No difference other than specifying Unicode literals for SQLConnect.

HENV envHnd;
HDBC conHnd;
HSTMT stmtHnd;
RETCODE rc;

rc = SQL_SUCCESS;

// ENV is allocated
rc = SQLAllocEnv(&envHnd);
// Connection Handle is allocated
rc = SQLAllocConnect(envHnd, &conHnd);
rc = SQLConnect(conHnd, _T("stpc19"), SQL_NTS, _T("scott"), SQL_NTS, _T("tiger"), SQL_NTS);

if (conHnd)
SQLFreeConnect(conHnd);
if (envHnd)
SQLFreeEnv(envHnd);

List 2: Simple Retrieval

The following example retrieves the employee names and the job tiles from the EMP table.
With the exception that you need to specify TCHAR compliant data to every ODBC function,
there is no difference to the ANSI case. If the case is a Unicode application, you have to
specify the length of the buffer to the BYTE length when you call SQLBindCol (for example,
sizeof(ename) ).

/*
** Execute SQL, bind columns, and Fetch.
** Procedure:
**
** SQLExecDirect
** SQLBindCol
** SQLFetch
**
*/
static SQLTCHAR *sqlStmt = _T("SELECT ename, job FROM emp");
SQLTCHAR ename[50];
SQLTCHAR job[50];
SQLINTEGER enamelen, joblen;

_tprintf(_T("Retrieve ENAME and JOB using SQLBindCol 1...\n[%s]\n"), sqlStmt);

// Step 1: Prepare and Execute


rc = SQLExecDirect(stmtHnd, sqlStmt, SQL_NTS); // select
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 2: Bind Columns


rc = SQLBindCol(stmtHnd,
1,
SQL_C_TCHAR,
ename,
sizeof(ename),
&enamelen);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

rc = SQLBindCol(stmtHnd,
2,
SQL_C_TCHAR,
job,
sizeof(job),
&joblen);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

do
{
// Step 3: Fetch Data
rc = SQLFetch(stmtHnd);
if (rc == SQL_NO_DATA)
break;
checkSQLErr(envHnd, conHnd, stmtHnd, rc);
_tprintf(_T("ENAME = %s, JOB = %s\n"), ename, job);
} while (1);
_tprintf(_T("Finished Retrieval\n\n"));

List 3: Retrieval Using SQLGetData (Binding After Fetch)

This example shows how to use SQLGetData. For those who are not familiar with ODBC
programming, the fetch is allowed before binding the data using SQLGetData, unlike in an
OCI program. There is no difference to the ANSI application in terms of Unicode-specific
issues.

/*
** Execute SQL, bind columns, and Fetch.
** Procedure:
**
** SQLExecDirect
** SQLFetch
** SQLGetData
*/
static SQLTCHAR *sqlStmt = _T("SELECT ename,job FROM emp"); // same as Case 1.
SQLTCHAR ename[50];
SQLTCHAR job[50];

_tprintf(_T("Retrieve ENAME and JOB using SQLGetData...\n[%s]\n"), sqlStmt);


if (rc != SQL_SUCCESS)
{
_tprintf(_T("Failed to allocate STMT\n"));
goto exit2;
}
// Step 1: Prepare and Execute
rc = SQLExecDirect(stmtHnd, sqlStmt, SQL_NTS); // select
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

do
{
// Step 2: Fetch
rc = SQLFetch(stmtHnd);
if (rc == SQL_NO_DATA)
break;
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 3: GetData
rc = SQLGetData(stmtHnd,
1,
SQL_C_TCHAR,
(SQLPOINTER)ename,
sizeof(ename),
NULL);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);
rc = SQLGetData(stmtHnd,
2,
SQL_C_TCHAR,
(SQLPOINTER)job,
sizeof(job),
NULL);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);
_tprintf(_T("ENAME = %s, JOB = %s\n"), ename, job);
} while (1);
_tprintf(_T("Finished Retrieval\n\n"));

List 4: Simple Update

This example shows how to update data. Likewise, the length of data for
SQLBindParameter has to be specified with the BYTE length, even in the case of a
Unicode application.

/*
** Execute SQL, bind columns, and Fetch.
** Procedure:
**
** SQLPrepare
** SQLBindParameter
** SQLExecute
*/
static SQLTCHAR *sqlStmt = _T("INSERT INTO emp(empno,ename,job) VALUES(?,?,?)");
static SQLTCHAR *empno = _T("9876"); // Emp No
static SQLTCHAR *ename = _T("ORACLE"); // Name
static SQLTCHAR *job = _T("PRESIDENT"); // Job

_tprintf(_T("Insert User ORACLE using SQLBindParameter...\n[%s]\n"), sqlStmt);


// Step 1: Prepare
rc = SQLPrepare(stmtHnd, sqlStmt, SQL_NTS); // select
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 2: Bind Parameter


rc = SQLBindParameter(stmtHnd,
1,
SQL_PARAM_INPUT,
SQL_C_TCHAR,
SQL_DECIMAL,
4, // 4 digit
0,
(SQLPOINTER)empno,
0,
NULL);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

rc = SQLBindParameter(stmtHnd,
2,
SQL_PARAM_INPUT,
SQL_C_TCHAR,
SQL_CHAR,
lstrlen(ename)*sizeof(TCHAR),
0,
(SQLPOINTER)ename,
lstrlen(ename)*sizeof(TCHAR),
NULL);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

rc = SQLBindParameter(stmtHnd,
3,
SQL_PARAM_INPUT,
SQL_C_TCHAR,
SQL_CHAR,
lstrlen(job)*sizeof(TCHAR),
0,
(SQLPOINTER)job,
lstrlen(job)*sizeof(TCHAR),
NULL);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 3: Execute
rc = SQLExecute(stmtHnd);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

List 5: Update and Retrieval for Long Data(CLOB)

This example may be the most complicated case to update and retrieve data for long data,
like CLOB, in Oracle. Since the length of data should be always the BYTE length,
lstrlen(TCHAR data)*sizeof(TCHAR) is needed to derive the BYTE length.

/*
** Execute SQL, bind columns, and Fetch.
** Procedure:
**
** SQLPrepare
** SQLBindParameter
** SQLExecute
** SQLParamData
** SQLPutData
**
** SQLExecDirect
** SQLFetch
** SQLGetData
*/
static SQLTCHAR *sqlStmt1 = _T("INSERT INTO clobtbl(clob1) VALUES(?)");
static SQLTCHAR *sqlStmt2 = _T("SELECT clob1 FROM clobtbl");
SQLTCHAR clobdata[1001];
SQLTCHAR resultdata[1001];
SQLINTEGER ind = SQL_DATA_AT_EXEC;
SQLTCHAR *bufp;
int clobdatalen, chunksize, dtsize, retchklen;

_tprintf(_T("Insert CLOB1 using SQLPutData...\n[%s]\n"), sqlStmt1);

// Set CLOB Data


{
int i;
SQLTCHAR ch;
for (i=0, ch=_T('A'); i< sizeof(clobdata)/sizeof(SQLTCHAR); ++i, ++ch)
{
if (ch > _T('Z'))
ch = _T('A');
clobdata[i] = ch;
}
clobdata[sizeof(clobdata)/sizeof(SQLTCHAR)-1] = _T('\0');
}
clobdatalen = lstrlen(clobdata); // length of characters
chunksize = clobdatalen / 7; // 7 times to put

// Step 1: Prepare
rc = SQLPrepare(stmtHnd, sqlStmt1, SQL_NTS);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 2: Bind Parameter with SQL_DATA_AT_EXEC


rc = SQLBindParameter(stmtHnd,
1,
SQL_PARAM_INPUT,
SQL_C_TCHAR,
SQL_LONGVARCHAR,
clobdatalen*sizeof(TCHAR),
0,
(SQLPOINTER)clobdata,
clobdatalen*sizeof(TCHAR),
&ind);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 3: Execute
rc = SQLExecute(stmtHnd);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 4: ParamData (initiation)


rc = SQLParamData(stmtHnd, (SQLPOINTER*)&bufp); // set value
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

for (dtsize=0, bufp = clobdata;


dtsize < clobdatalen;
dtsize += chunksize, bufp += chunksize)
{
int len;
if (dtsize+chunksize<clobdatalen)
len = chunksize;
else
len = clobdatalen-dtsize;
// Step 5: PutData
rc = SQLPutData(stmtHnd, (SQLPOINTER)bufp, len*sizeof(TCHAR));
checkSQLErr(envHnd, conHnd, stmtHnd, rc);
}
// Step 6: ParamData (temination)
rc = SQLParamData(stmtHnd, (SQLPOINTER*)&bufp);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

rc = SQLFreeStmt(stmtHnd, SQL_CLOSE);
_tprintf(_T("Finished Update\n\n"));
rc = SQLAllocStmt(conHnd, &stmtHnd);
if (rc != SQL_SUCCESS)
{
_tprintf(_T("Failed to allocate STMT\n"));
goto exit2;
}

// Clear Result Data


memset(resultdata, 0, sizeof(resultdata));
chunksize = clobdatalen / 15; // 15 times to put

// Step 1: Prepare
rc = SQLExecDirect(stmtHnd, sqlStmt2, SQL_NTS); // select
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

// Step 2: Fetch
rc = SQLFetch(stmtHnd);
checkSQLErr(envHnd, conHnd, stmtHnd, rc);

for(dtsize=0, bufp = resultdata;


dtsize < sizeof(resultdata)/sizeof(TCHAR) && rc != SQL_NO_DATA;
dtsize += chunksize-1, bufp += chunksize-1)
{
int len; // len should contain the space for NULL termination
if (dtsize+chunksize<sizeof(resultdata)/sizeof(TCHAR))
len = chunksize;
else
len = sizeof(resultdata)/sizeof(TCHAR)-dtsize;
// Step 3: GetData
rc = SQLGetData(stmtHnd,
1,
SQL_C_TCHAR,
(SQLPOINTER)bufp,
len*sizeof(TCHAR),
&retchklen);
}
if (!_tcscmp(resultdata, clobdata))
{
_tprintf(_T("Succeeded!!\n\n"));
}
else
{
_tprintf(_T("Failed!!\n\n"));
}
API Conformance (Programming)
The Oracle8 ODBC Driver release 8.1.7.1.0 supports all Core and Level 2 functions, and all
Level 1 functions with the following exceptions:
• SQLBulkOperations
In addition, the Oracle8 ODBC Driver release 8.1.7.1.0 supports translation DLLs.
The following Help topic describes the ODBC API functions implemented by the Oracle8
ODBC Driver:
For Programmers
Implementation of ODBC API Functions (Programming)

See Also: For Advanced Users


Implementation of ODBC API Functions
(Programming)
The following table describes how the Oracle8 ODBC Driver implements specific functions:

Function Description
SQLConnect SQLConnect requires only a DBQ, user Id, and
password.
SQLDriverConnect SQLDriverConnect uses the DSN, DBQ, UID, and PWD
keywords.
SQLSpecialColumns If SQLSpecialColumns is called with the
SQL_BEST_ROWID attribute, it always returns the
rowid column.
SQLProcedures and See the information that follows.
SQLProcedureColumns

SQLProcedures and SQLProcedureColumns

The SQLProcedures and SQLProcedureColumns calls have been modified to locate and
return information about all procedures and functions even if they are contained within a
package. Previously, the calls only found procedures and functions that were outside of
packages. The following examples and scenarios show what procedures or functions are
returned.
Assume you have the following 8 stored procedures:
"BAR"
"BARX"
"XBAR"
"XBARX"
"SQLPROCTEST.BAR"
"SQLPROCTEST.BARX"
"SQLPROCTEST.XBAR"
"SQLPROCTEST.XBARX"

When you look for "%" or "%%%%%%", you get: all 8 procedures
When you look for "%_" or "_%", you get:
"BAR"
"BARX"
"XBAR"
"XBARX"

When you look for "." or ".%" or "%.%" or "SQLProc%." or "SQLProc%.%", you get:
"SQLPROCTEST.BAR"
"SQLPROCTEST.BARX"
"SQLPROCTEST.XBAR"
"SQLPROCTEST.XBARX"
When you look for "%bar", you get:
"BAR"
"XBAR"

When you look for ".%bar" or "%.%bar", you get:


"SQLPROCTEST.BAR"
"SQLPROCTEST.XBAR"

When you look for "SQLProc%" or ".SQLProc%", you get:


nothing (0 rows)
Implementation of the ODBC SQL Syntax
(Programming)
If a comparison predicate has a parameter marker as the second expression in the
comparison and the value of that parameter is set to SQL_NULL_DATA with
SQLBindParameter, the comparison will fail. This is consistent with the null predicate syntax
in ODBC SQL.
Implementation of Data Types (Programming)
For programmers, the noteworthy part of the implementation of the data types concerns the
CHAR, VARCHAR, and VARCHAR2 data types.
For an fSqlType value of SQL_VARCHAR, SQLGetTypeInfo returns the Oracle database
data type VARCHAR2. For an fSqlType value of SQL_CHAR, SQLGetTypeInfo returns the
Oracle database data type CHAR.
Application Options
Enable Result Sets - enables the processing of Oracle Result Sets. If Result Sets are not
required for your application, Result Set support can be disabled. There is a small
performance penalty for procedures called from packages not containing Result Sets. Result
Sets are enabled by default.
Enable Query Timeout - enables query timeout for SQL queries. By default, the Oracle8
ODBC Driver supports the SQL_ATTR_QUERY_TIMEOUT attribute for the SQLSetStmtAttr
function. If this box is not checked, the Oracle8 ODBC Driver responds with a “not capable”
message. Query Timeout is enabled by default.
Read Only Connection - check this box to force read-only access. The default is write
access.
Enable Closing Cursors - enables closing cursors. By default, closing cursors is disabled
(the field is empty), meaning a call to close a cursor does not force the closing of OCI
cursors when this behavior is not desired because it can cause an unnecessary performance
hit. You should enable closing cursors when it is desirable to force the closing of OCI cursors
upon a call to close a cursor.
Note: There is an impact on performance each time a cursor is closed.

Enable Thread Safety - thread safety can be disabled for a data source. If thread safety is
not required, disabling this option eliminates the overhead of using thread safety. By default,
thread safety is enabled.
Batch Autocommit Mode - By default, commit is executed only if all statements succeed.
Oracle Options
Enable LOBs - enables the writing of Oracle LOBs. If writing Oracle LOBs is not required for
your application, LOB support can be disabled. There is a small performance penalty for
insert and update statements when LOBs are enabled. LOB writing is enabled by default but
disabled for Oracle databases that do not support the LOB datatype.
Enable Failover - enables Oracle Fail Safe and Oracle Parallel Server failover retry. The
Oracle client must be release 8.0.5 or higher. This option in an enhancement to the failover
capabilities of Oracle Fail Safe and Oracle Parallel Server. Enable this option to configure
additional failover retries. The default is enabled.
Retry Count - the number of times the connection failover will be attempted. The default is
10 attempts.
Delay - the number of seconds to delay between failover attempts. The default is 10
seconds.
Note: See the Oracle Fail Safe and Oracle Parallel Server documentation on
how to set up and use both of these products.

Prefetch Count - a numeric value that sets the number of rows that the ODBC Driver will
fetch at a time from an Oracle database. The default is 10 rows. To tune your application, set
a value that optimizes network use versus PC memory use. For example, if you only need to
view the first couple of rows, set this value to 3 or 4, thus allowing a fetch of 3 or 4 rows in
one operation versus fetching one row at a time and increasing network use; if you need to
always view the first 25 rows, set this value to 25 to fetch 25 rows in one operation, but
realize that you will use more PC memory to hold these rows.
Note: The Oracle database from which your application is fetching rows must be
release 8.0.3 or higher.
Workarounds Options
Force Retrieval of Long Columns - check this box to read the entire Oracle long datatype
into memory during SQLFetch. Oracle restricts any read/write operations to be performed
once the streaming of data from a long column has started. Therefore, the contents of an
LOB column cannot be accessed until the data for all long columns has been retrieved. The
Oracle8 ODBC Driver will force the entire read on the long column and place it into memory
until the application is ready to receive it. This frees up the application to do other read/write
operations on the database. The size of the data in the long column determines the memory
consumption on the client. Force Retrieval of Long Columns is disabled by default.
Note: This feature could exhaust a PC of memory if the data in the long column
is too big. This feature degrades performance because the data for all long
columns must be copied twice, once to internal buffers and once to the
applications buffer.

Disable MTS Support - check this box to disable Microsoft Transaction Server (MTS)
support. By default MTS support is enabled.
Force SQL_WCHAR Support - check this box to enable SQLDescribeCol to return the data
type of SQL_WCHAR for SQL_CHAR columns; SQL_WVARCHAR for SQL_VARCHAR
columns; and SQL_WLONGVARCHAR for SQL_LONGVARCHAR columns. This feature
enables Unicode support in applications that rely on the results of SQLDescribeCol (for
example, ADO). This support is disabled by default.
SQLServer Migration Options
EXEC Syntax Enabled - enables support for SQL Server EXEC syntax. A procedure (or
function) call specified in an EXEC statement is translated to its equivalent Oracle procedure
(or function) call before being processed by an Oracle8 database server. By default this
option is disabled.
Schema Field - the translated Oracle procedure (or function) is assumed to be defined in
the user’s default schema. However, if all procedures (or functions) from the same
SQLServer database are migrated to the same Oracle schema with their database name as
the schema name, this field should be set to database. By the same token, this field should
be set to owner if all procedures (or functions) owned by the same SQLServer user are
defined in the same Oracle schema. This field is empty by default.
Translation Options
Translation Option - a numeric value that is passed to the translation library when it is
called by the Oracle8 ODBC Driver. The default is zero (0).
Translation Library - the name of a translation library that is to be called by the Oracle8
ODBC Driver.
Acknowledgments
Copyright And Trademark Acknowledgments
Copyright © 1993, 2000, Oracle Corporation. All rights reserved
The Programs (which include both the software and documentation) contain proprietary
information of Oracle Corporation; they are provided under a license agreement containing
restrictions on use and disclosure and are also protected by copyright, patent, and other
intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation
of the Programs is prohibited.
The information contained in this document is subject to change without notice. If you find
any problems in the documentation, please report them to us in writing. Oracle Corporation
does not warrant that this document is error free. Except as may be expressly permitted in
your license agreement for these Programs, no part of these Programs may be reproduced
or transmitted in any form or by any means, electronic or mechanical, for any purpose,
without the express written permission of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the
programs on behalf of the U.S. Government, the following notice is applicable:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are
"commercial computer software" and use, duplication, and disclosure of the Programs,
including documentation, shall be subject to the licensing restrictions set forth in the
applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal
Acquisition Regulations are "restricted computer software" and use, duplication, and
disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial
Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle
Parkway, Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or
other inherently dangerous applications. It shall be the licensee's responsibility to take all
appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of
such applications if the Programs are used for such purposes, and Oracle Corporation
disclaims liability for any damages caused by such use of the Programs.
Oracle is a registered trademark, and Net8, Oracle8, and Oracle Call Interface are
trademarks or registered trademarks of Oracle Corporation. Other names may be
trademarks of their respective owners.
Glossary
Data Source

The data source consists of the data that the user wants to access, and its associated
operating system, database management system (for instance, an Oracle database), and
the network transport (Net8 ), used to access the database management system.
Net8

An Oracle product that works with the Oracle server and enables two or more computers that
run the Oracle server to exchange data through a third-party network. Net8 supports
distributed processing and distributed database capability. Net8 is independent of the
communications protocol, and users can interface Net8 to many network environments.
API

Application Program Interface. A set of program functions or calls that allow an application
to make use of, or communicate with, an underlying program or system.
Conformance Levels

Some applications can only use drivers that support certain levels of functionality or
conformance levels. For example, an application might want to set the cursor position in a
rowset and allow an application to refresh data in the rowset. This ability is part of the Level
1 conformance level for the Application Programming Interface (API).
ODBC drivers conform to one of three API levels (Core, Level 1, or Level 2) and is broadly
compatible with the SQL-99 Core specification. Drivers may support some of the
functionality in levels above their stated level.
For detailed information about what is in the various conformance levels, programmers
should see the Microsoft ODBC 3.0 Software Development Kit and Programmer's Reference.
DBMS

A Database Management System normally encompassing computerized management


facilities that are used to structure and manipulate data, and to ensure privacy, recovery, and
integrity in a multi-user environment.
DDL

Data Definition Language. The category of SQL statements that define or delete database
objects such as tables or views. Examples include the SQL CREATE TABLE and DROP
VIEW statements.
DLL

Dynamic Link Library. A set of routines that one or more applications can use to perform
common tasks. The ODBC drivers are DLLs.
DML

Data Manipulation Language. The category of SQL statements that query and update the
database data. Examples include the SQL UPDATE, INSERT, and DELETE statements.
ODBC

Open Database Connectivity. A Driver Manager and a set of ODBC drivers that enable
applications to access data using SQL as a standard language.
SQL

Structured Query Language. The internationally accepted standard for relational systems,
covering not only query but also data definition, manipulation, security, and some aspects of
referential integrity.
Client

A client is a software program that accesses data by selecting a service provided by a server
using an agreed upon interface. The server responds by receiving and processing client
requests, and sending the results back to the client. ODBC client applications use the ODBC
Driver API to call ODBC functions to submit SQL statements and retrieve results.
Network

A network is made up of communications software and hardware through which an OCI


client on a PC communicates with an Oracle server on another computer system. Message
requests from the OCI client and response requests from the server travel over a Net8
communications link that can support a variety of network transports such as Microsoft LAN
Manager, Novell NetWare, Banyan VINES, DECnet, or any TCP/IP network.
Oracle Call Interface

The Oracle Call Interface (OCI) is a set of standard software routines (program call
interface) used to access an Oracle server. OCI allows users to embed Oracle calls directly
into high-level languages.
IPX/SPX

Internetwork Packet Exchange (IPX)/Sequenced Packet Exchange (SPX). IPX is a


connectionless protocol that performs the tasks of the Network layer of the Open Systems
Interconnection (OSI) model that includes addressing, routing, and switching information
packets from one location to another on a network. SPX is a connection-oriented protocol
that performs the tasks of the Transport layer of the OSI model one layer above the Network
layer. SPX is identical to IPX except that it has the additional tasks of guaranteeing delivery,
sequencing of packets, detecting and correcting errors, and suppressing packet duplication.
TCP/IP

Transmission Control Protocol (TCP)/Internet Protocol (IP). An interprocess communication


mechanism used by applications to share data across a network. TCP allows a process on
one machine to send a stream of data to a process on another machine. Software
implementing TCP usually resides in the operating system and uses the IP to transmit
information across the Internet.
Net8

Oracle Corporation's family of networking products that transparently integrates clients,


servers, and gateways to deliver a unified information resource using industry-standard or
proprietary network protocols.
Oracle Net8 Assistant

A utility to easily configure and maintain a Net8 network by updating entries in the
tnsnames.ora file for each of your TNS Service Names.
DECnet

A Compaq Computer Corporation software facility that implements the DIGITAL Network
Architecture (DNA) to let a user access information on a remote computer through
telecommunications lines. A DECnet network enables an OpenVMS Alpha or OpenVMS VAX
system to function as a network node and, for instance, allows programs running on one
node to remotely access an Oracle server on another node in the same DECnet network.
Oracle8 ODBC Driver

The Oracle8 ODBC Driver allows Microsoft ODBC Windows 95, Windows 98, Windows
2000, and Windows NT X86 applications read and write access to Oracle databases using
Net8 . The Oracle8 ODBC Driver links the application to an Oracle data source. The
Oracle8 ODBC Driver are dynamic-link libraries that an application can invoke on demand to
gain access to an Oracle database.
ODBC Application

The ODBC application performs processing and calls ODBC functions to submit SQL
statements and retrieve results. The application can access multiple data drivers, each of
which accesses a different data source.
Driver Manager

The Driver Manager, which is provided by Microsoft, loads drivers on behalf of an application
when the application calls the ODBC SQLConnect or ODBC SQLDriverConnect functions.
ODBC Driver

Microsoft’s Open Database Connectivity (ODBC) provides a standard interface that allows
one application to access many different data sources. The application’s source code does
not have to be recompiled for each data source. An ODBC driver is a dynamic-link library
that applications can invoke on demand to gain access to a data source. An ODBC driver
links the application to a specific data source and processes ODBC function calls, submits
SQL requests to a specific data source, and returns results to the application. If necessary,
the ODBC driver modifies an application's request so that the request conforms to syntax
supported by the associated data source. The Driver Manager and the ODBC driver appear
to an application as one unit that processes ODBC function calls.
Data Source (Oracle)

A data source includes information about the data a user wants to access and information
needed to get to that data. For the Oracle8 ODBC Driver, a data source is an alias for a
specific instance of an Oracle database and the Net8 components used for communication
to the Oracle database.
Oracle8

Oracle8 is a high performance, high availability, scalable, general purpose, multiuser,


database management system based on the relational model extended with objects that runs
on a wide variety of computer operating systems. It supports a full set of utilities and an
industry-standard SQL data definition and data manipulation language that lets you create,
query, and maintain your Oracle8 databases. Oracle8 supports VLDB, high-end OLTP and
data warehouse applications, and contains enhanced management capabilities using the
Oracle8 Enterprise Manager GUI and enhanced security using the Oracle Security Server.

S-ar putea să vă placă și