Copyright: , 1996 INTERSOLV


Contents, INGRES 6.4/04 Driver Help
	DataDirect ODBC  INGRES 6.4/04 Driver
About the INGRES 6.4/04 Driver

System Requirements

Configuring Data Sources

Connecting to INGRES Using a Logon Dialog Box

Connecting to INGRES Using a Connection String

Data Types

Isolation and Lock Levels Supported

ODBC Conformance Level

Number of Connections and Statements Supported

Copyright


Copyright
Copyright 1996 INTERSOLV Inc. All rights reserved. INTERSOLV is a registered trademark, and DataDirect is a trademark of INTERSOLV, Inc. Other company or product names mentioned herein may be trademarks or registered trademarks of their respective companies.


About the INGRES 6.4/04 Driver

The INGRES driver supports INGRES Release 6.4/04. The driver filename is IVING4nn.DLL for Release 6.4/04 and higher.


INGRES System Requirements
System Requirements

The 32-bit DataDirect INGRES 6.4/04 driver works on Windows NT only; this driver is not supported on Windows 95.

To access INGRES databases from your client workstation, you must have the INGRES/Net product installed on both your client and server nodes.

To access INGRES, you must have Networking for Windows NT Release 6.4/05 (int.wnt/01) or later.

Note: The DataDirect INGRES 6.4/04 driver for Windows NT requires INGRES/Net. This driver does not work with INGRES Open Road or Open INGRES client software.

You must have the environment variable II_SYSTEM set to the directory where you installed the INGRES/Net product.  For example:

SET II_SYSTEM=C:\

You may get an error message if you attempt to configure a data source and do not have the following files:

LIBQ32.DLL

ADF32.DLL

CL32_1.DLL

GCA32.DLL

MSVCRT10.DLL.

If these files are not on your path, or in your Windows NT \SYSTEM32 or Windows 95 \SYSTEM directory, the following message appears:

The setup routines for the INTERSOLV INGRES ODBC driver could not be loaded.  You may be low on memory and need to quit a few applications.


Configuring INGRES Data Sources
Configuring Data Sources

To configure an INGRES data source, do the following:

1	Start the ODBC Administrator.  A list of data sources appears.

2	If you are configuring a new data source, click Add.  A list of installed drivers appears.  Select INTERSOLV INGRES 6.4/04 and click OK.

If you are configuring an existing data source, select the data source name and click Setup.

The INGRES 6.4/04 ODBC Setup dialog box appears.

3	Specify a data source name, a server name and optionally, a description.

4	Click the Advanced button to configure optional data source settings, such as file caching information. The ODBC Advanced Driver Setup dialog box appears.

5	Click Translate to perform a translation of your data from one character set to another. The Select Translator dialog box appears in which you can select a translator to peform the translation. INTERSOLV provides a translator named INTERSOLV OEM ANSI that translates your data from the IBM PC character set to the ANSI character set. Click OK to leave this dialog box and perform the translation.

The translators that are listed in this dialog box are determined by the values listed in the ODBC Translators section of your ODBCINST.INI file.

6	Click OK to write these values to ODBC.INI.  These values are now the defaults when you connect to the data source.  You can change the defaults by configuring your data source again.  You can override the defaults by connecting to the data source using a connection string with alternate values.


Connecting to INGRES Using a Logon Dialog Box

Some ODBC applications display a logon dialog box when you are connecting to a data source.  In these cases, the data source name has already been specified.

In the Logon dialog box, do the following:

1	Type the server name of the computer containing the INGRES database you want to access or select the name from the Server Name drop-down list, which displays the server names you specified in the setup dialog box.  Server Name must be a valid virtual node that has been added using the INGRES NETU utility.

2	Type the name of the database to which you want to connect or select the name from the Database Name drop-down list, which displays the names you specified in the setup dialog box.

3	If required, type your user name.

4	Type any options for the connection.  The options can be any flags allowed on the INGRES SQL command line.

5	Click OK to log on to INGRES and to update the values in ODBC.INI.


Connecting to INGRES Using a Connection String

If your application requires a connection string to connect to a data source, you must specify the data source name that tells the driver which ODBC.INI section to use for the default connection information.  Optionally, you may specify attribute=value pairs in the connection string to override the default values stored in ODBC.INI.  These values are not written to ODBC.INI.

You can specify either long or short names in the connection string.  The connection string has the form:

DSN=data_source_name[;attribute=value[;attribute=value]...]

An example of a connection string for INGRES is

DSN=INGRES TABLES;SRVR=IVSERV;DB=PAYROLL;UID=JOHN

The following table gives the long and short names for each attribute, as well as a description.

The defaults listed in the table are initial defaults that apply when no value is specified in either the connection string or in the data source definition in ODBC.INI.  If you specified a value for the attribute when configuring the data source, that value is your default.

Attribute	Description
DataSourceName (DSN)	A string that identifies an INGRES data source configuration in ODBC.INI.  Examples include "Accounting" or "INGRES-Serv1."
ServerName (SRVR)	The name of the virtual node that you defined using the INGRES NETU utility.  This virtual node tells INGRES which system to call, how to call it, and the user's name and password.
Database (DB)	The name of the database to which you want to connect.
LogonID (UID)	The default logon ID (user name) used to connect to your INGRES database.  A logon ID is required only if security is enabled on your database.  If so, contact your system administrator to get your logon ID.
Options (OPTS)	The flags allowed on the INGRES SQL command line.  Some examples are -l (locks the database exclusively) -u (logs on as username) -w or -w (waits/doesn't wait for the database if someone has already opened it exclusively) +U or -U (enables/disables user updating system tables and locks the database exclusively) +Y or -Y (enables/disables user updating system tables but does not lock the database exclusively)
YieldProc (YLD)	This attribute is not available under Windows NT or  Windows 95. A value that determines if you can work in other applications when INGRES is busy.
RepeatedCache Size (RCS)	A number that determines whether all Update and Insert statements are to be executed as repeated statements. This attribute improves the performance of applications that repeat the same SQL statement. When set to 0, the initial default, no statements are repeated. The recommended setting for this attribute is 100 (RepeatedCacheSize=100). To repeat a single statement rather than all statements, use the INGRES REPEATED syntax.
RepeatedSelects (RS)	RepeatedSelects={0 | 1 | 2}. A number that determines whether the driver optimizes Select statements or executes them as repeated queries. When set to 0, the initial default, the driver executes all Select statements as it did in previous versions of the product. When set to 1, the driver optimizes Select statements that return only one result row. When set to 2, the driver executes all Select statements as repeated queries. If this attribute is set to 1 or 2, the RepeatedCacheSize attribute must be set to greater than zero. Setting this option to 1 or 2: has no effect on Select statements containing a For Update clause limits the driver to one active statement and one active connection
ValueReplacement (VR)	ValueReplacement={0 | 1}. A number that determines whether the driver substitutes parameters for hardcoded values in repeated statements. This option is convenient in applications that do not use dynamic parameters. When set to 0, the initial default, the driver doesnot substitute parameters. When set to 1, the driver substitutes parameters for hardcoded values and the RepeatedCacheSize attribute must be greater than zero or the REPEATED INGRES keyword must be used. This option has no effect upon Select statements that contain a For Update clause that requires a cursor or upon statements that already use parameter markers. This attribute supports only a subset of standard ODBC SQL grammer. It is intended for performance and does not utilize a full SQL parser. For example, subselects are not supported and use of “is NULL” for columns other than character columns is not supported.


INGRES Data Types
Data Types

INGRES data types map to the standard ODBC data types as follows:

INGRES	ODBC
Char	SQL_CHAR
Date	SQL_TIMESTAMP
Float	SQL_DOUBLE
Float4	SQL_REAL
Integer	SQL_INTEGER
Integer1	SQL_TINYINT
Money	SQL_DECIMAL
Smallint	SQL_SMALLINT
Varchar	SQL_VARCHAR
Note  INGRES date values do not directly map to the ODBC type SQL_TIMESTAMP. If interval data is placed in Date columns, then the driver raises an error when attempting to read the value.


Isolation and Lock Levels Supported by INGRES
Isolation and Lock Levels Supported

INGRES supports isolation levels 1 (read committed, the default) and 3 (serializable).  INGRES supports page-level locking.


INGRES ODBC Conformance Level
ODBC Conformance Level

The INGRES driver supports the Core, Level 1, and Level 2 API functions listed in Supported ODBC Functions.  In addition, the SQLBrowseConnect Level 2 function is supported.

The driver supports the minimum SQL grammar.


Number of Connections and Statements Supported by INGRES
Number of Connections and Statements Supported

The INGRES database system supports multiple connections and multiple statements per connection.

Note that if you set the RepeatedSelects connection string attribute to 1 or 2, the driver is limited to one active statement and one active connection.


INGRES ODBC Setup Dialog
INGRES 6.4/04 ODBC Setup Dialog

Use the INGRES 6.4/04 ODBC Setup dialog to create new INGRES 6.4/04 data sources or configure existing data sources.

Data Source Name:  A string that identifies this INGRES data source configuration in ODBC.INI.  Examples include "Accounting" or "INGRES-Serv1."

Description:  An optional long description of a data source name.  For example, "My Accounting Database" or "INGRES on Server number 1."

Server Name:  The name of the virtual node that you defined using the INGRES NETU utility.  This virtual node tells INGRES which system to call, how to call it, and the user's name and password.

Database Name:  The name of the database to which you want to connect by default.

Advanced: Displays the ODBC Advanced Driver Setup dialog box to configure optional data source settings, such as file caching.

OK

Creates or modifies the current data source using the options you specify.

Cancel

Exits the ODBC Setup dialog without creating or modifying a data source.


Advanced Options for Configuring Data Sources
Advanced Dialog

To configure optional settings for an INGRES 6.4/04 data source, specify values as follows:

Server List:  The list of servers (virtual nodes) that will be available in the Logon dialog box.  Separate the server names with commas.

Database List:  The list of databases that will be available in the logon dialog box.  Separate the names with commas.

Default User Name:  The default user name used to connect to your INGRES database.  A user name is required only if security is enabled on your database.  Your ODBC application may override this value or you may override this value in the logon dialog box.

Options:  Any flag allowed on the INGRES SQL command line.  Some examples are

-l (locks the database exclusively)

-u (logs on as username)

+w or -w (waits/doesn't wait for the database if a user has already opened it exclusively)

+U or -U (enables/disables user updating of the system tables and locks the database exclusively)

+Y or -Y (enables/disables user updating of the system tables but does not lock the database exclusively)

Yield Proc:  This attribute is not available in Windows 95 or Windows NT. A numeric value that determines whether you can work in other applications when INGRES is busy.

Repeated Cache Size: A number that determines whether all Update and Insert statements are to be executed as repeated statements. This attribute improves the performance of applications that repeat the same SQL statement. When set to 0, the initial default, no statements are repeated. The recommended setting for this attribute is 100 (RepeatedCacheSize=100).

To repeat a single statement rather than all statements, use the INGRES REPEATED syntax.

Repeated Selects: A number that determines whether the driver optimizes Select statements or executes them as repeated queries. When set to 0, the initial default, the driver executes all Select statements as it did in previous versions of the product.

When set to 1, the driver optimizes Select statements that return only one result row. When set to 2, the driver executes all Select statements as repeated queries. If this attribute is set to 1 or 2, the RepeatedCacheSize attribute must be set to greater than zero.

Setting this option to 1 or 2:

has no effect on Select statements containing a For Update clause

limits the driver to one active statement and one active connection

Value Replacement for Repeated Selects: A number that determines whether the driver substitutes parameters for hardcoded values in repeated statements. This option is convenient in applications that do not use dynamic parameters.

When set to 0, the initial default, the driver doesnot substitute parameters. When set to 1, the driver substitutes parameters for hardcoded values and the RepeatedCacheSize attribute must be greater than zero or the REPEATED INGRES keyword must be used.

This option has no effect upon Select statements that contain a For Update clause that requires a cursor or upon statements that already use parameter markers.

This atttribute supports only a subset of standard ODBC SQL grammar. It is intended for performance and does not utilize a full SQL parser. For example, subselects are not supported and use of "is NULL" for columns other than character columns is not supported.

Translate: Displays the Select Translator dialog box to allow you to perform a translation of your data from one character set to another. Choose the INTERSOLV OEM ANSI translator to translate your data from the IBM PC character set to the ANSI character set.

Close

Returns to the INGRES 6.4/04 ODBC Setup dialog box where you can click the OK button to write these settings to the ODBC.INI file.


Logon to INGRES

Server Name:  Enter the server name of the computer containing the INGRES database you wish to access or select the name from the Server Name box, which displays the server names you specified in the Setup dialog box. Server Name must be a valid Virtual Node that has been added using the INGRES NETU utility.

Database Name:  Enter the name of the database to which you want to connect or select the name from the Database Name box, which displays the names you specified in the Setup dialog box.

User Name:  Enter your user name.

Options:  Enter any options for the connection. The options can be any flags allowed on the INGRES SQL command line.