Copyright: , 1996 INTERSOLV


Contents, Sybase System 10 Driver Help
	DataDirect ODBC  System 10 Driver
About the System 10 Driver

System Requirements

Configuring Data Sources

Connecting to System 10 Using a Logon Dialog Box

Connecting to Sybase  System 10 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 System 10 Driver

The System 10 driver supports the SQL Server System 10 database system from Sybase.

The driver filename is IVSYBnn.DLL.


Sybase System 10 System Requirements
System Requirements

To gain access to System 10, you must install the appropriate Sybase Net-Library and the Sybase Open Client-Library, version 10.03 or later for Windows NT, including the following DLLs:

LIBCS.DLL

LIBCOMN.DLL

LIBCT.DLL

LIBINTL.DLL

LIBTCL.DLL

Set the environment variable SYBASE to the directory where you have installed the SYBASE client. You set this environment variable in the Control Panel under System. For example:

SET SYBASE=C:\SQL10

SYBPING is a tool provided with Sybase net-libraries to test connectivity from your client workstation to the database server (servers that are added using SQLEdit).  Use this tool to test your connection.


Configuring Sybase System 10 Data Sources
Configuring Data Sources

To configure a System 10 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 Sybase System 10 and click OK.

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

The System 10 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 server list and database name.

The ODBC Advanced Driver Setup dialog box appears. After setting these options, click Close to return to the Advanced Setup dialog box.

5	To configure advanced performance options, click the Performance button on the Advanced Setup dialog box.

The ODBC Sybase System 10 Performance Setup dialog box appears. After setting these options, click Close to return to the Advanced Setup dialog box.

6	To perform a translation of your data from one character set to another, click Translate at the ODBC Setup dialog box. 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.

7	Click OK at the ODBC Setup dialog box 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 System 10 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 case-sensitive name of the server containing the System 10 database tables 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.

2	If required, type your case-sensitive login ID.

3	If required, type your case-sensitive password for the system.

4	Type the name of the database you want to access (case-sensitive) or select the name from the Database drop-down list, which displays the names you specified in the setup dialog box.

5	Click OK to complete the logon and to update the values in ODBC.INI.


Connecting to System 10 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 System 10 is

DSN=SYS10 TABLES;SRVR=IVSRVR;DB=PAYROLL;UID=JOHN;PWD=XYZZY

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 a single connection to a System 10 database.  Examples include "Accounting" or "Sys10-Serv1."
ServerName (SRVR)	The name of the server containing the System 10 tables you want to access.  If not supplied, the initial default is the server name in the DSQUERY environment variable.
LogonID (UID)	The default logon ID used to connect to your System 10 database.  This ID is case-sensitive.  A logon ID is required only if security is enabled on your database.  If so, contact your system administrator to get your logon ID.
Password (PWD)	A case-sensitive password.
Database (DB)	The name of the database to which you want to connect.
Language (LANG)	The national language corresponding to a subdirectory in $SYBASE/locales.
Charset (CS)	The name of a character set corresponding to a subdirectory in $SYBASE/charsets.
WorkstationID (WKID)	The workstation ID used by the client.
ApplicationName (APP)	The name used by System 10 to identify your application.
InterfacesFile (IFILE)	The pathname to the interfaces file.
ArraySize (AS)	The number of rows the driver retrieves from the server for a fetch.  This is not the number of rows given to the user.  This increases performance by reducing network traffic.  The initial default is 10 rows.
OptimizePrepare (OP)	OptimizePrepare={0 | 1 | 2}. A value that determines whether stored procedures are created on the server for every call to SQLPrepare. When set to 0, stored procedures are created for every call to SQLPrepare. This setting can result in bad performance. When set to 1, the initial default, the driver creates stored procedures only if the statement contains parameters. Otherwise, the statement is cached and executed directly at SQLExecute time. When set to 2, the driver never creates stored procedures.
SelectMethod (SM)	SelectMethod={0 | 1}. A value that determines whether database cursors are used for Select statements. When set to 0, the initial default, database cursors are used. In some cases performance degradation can ocur when performing large numbers of sequential Select statements because of the amount of overhead associated with creating database cursors. When set to 1, Select statements are executed directly without using database cursors. When set to 1, the data source is limited to one active statement and one active connection.
Password Encryption (PE)	Password Encryption={0 | 1}. A number that determines whether password encryption can be performed from the Open Client Library to the server (PasswordEncryption=1). When set to 0, the default, this cannot be done.
PacketSize (PS)	PacketSize={-1 | 0 | x}. A number that determines the number of bytes per network packet transferred from the database server to the client. The correct setting of this attribute can improve performance. When set to 0, the initial default, the driver uses the default packet size as specified in the System 10 server configuration. When set to -1, the driver computes the maximum allowable packet size on the first connect to the data source and save the value in the odbc.ini file. When set to x, an integer from 1 to 10, which indicates a multiple of 512 bytes (for example, PacketSize=6 means to set the packet size to 6 * 512 = 3072 bytes). For you to take advantage of this connection attribute, you must configure the System 10 server for a maximum network packet size greater than or equal to the value you specified for PacketSize. For example, sp_configure “maximum network packet size”, 5120 reconfigure Restart System 10 Server Note that the ODBC specification specifies a connect option, SQL_PACKET_SIZE, that offers this same functionality. To avoid conflicts with applications that may set both the connection string attribute and the ODBC connect option, they have been defined as mutually exclusive. If PacketSize is specified, you will receive a message “Driver Not Capable” if you attempt to call SQL_PACKET_SIZE. If you do not set PacketSize, then application calls to SQL_PACKET_SIZE are accepted by the driver
CursorCacheSize (CCS)	A value that determines the number of connections that the connection cache can hold. The default CursorCacheSize setting is 1. To set the connection cache, you must set the SelectMethod option to 1. Increasing the connection cache may increase performance of some applications, but requires additional database resources.


Sybase System 10 Data Types
Data Types

The System 10 data types are mapped to the standard ODBC data types as follows:

System 10	ODBC
binary	SQL_BINARY
bit	SQL_BIT
char	SQL_CHAR
datetime	SQL_TIMESTAMP
decimal	SQL_DECIMAL
float	SQL_FLOAT
image	SQL_LONGVARBINARY
int	SQL_INTEGER
money	SQL_DECIMAL
numeric	SQL_NUMERIC
real	SQL_REAL
smalldatetime	SQL_TIMESTAMP
smallint	SQL_SMALLINT
smallmoney	SQL_DECIMAL
sysname	SQL_VARCHAR
text	SQL_LONGVARCHAR
timestamp	SQL_VARBINARY
tinyint	SQL_TINYINT
varbinary	SQL_VARBINARY
varchar	SQL_VARCHAR
Note:  The nchar, nvarchar, sensitivity, and sensitivity_boundary data types are not supported.


Isolation and Lock Levels Supported by Sybase System 10
Isolation and Lock Levels Supported

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


Sybase System 10 ODBC Conformance Level
ODBC Conformance Level

The System 10 driver supports the Core, Level 1, and Level 2 API functions listed in Supported ODBC Functions.  In addition, the following Level 2 functions are supported:

SQLBrowseConnect

SQLColumnPrivileges

SQLForeignKeys

SQLPrimaryKeys

SQLProcedureColumns

SQLProcedures

SQLTablePrivileges

The driver supports the minimum SQL grammar.


Number of Connections and Statements Supported by Sybase System 10
Number of Connections and Statements Supported

The System 10 database system supports multiple connections and multiple statements per connection.


Sybase System 10 ODBC Setup
System 10 ODBC Setup Dialog

Use the SQL Server ODBC Setup dialog to create new System 10 data sources or configure existing data sources.

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

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

Server Name:  The name of the server that contains the System 10 tables you want to access.  If not supplied, the server name in the DSQUERY environment variable is used.

Advanced

Displays the ODBC Advanced Driver Setup dialog box to configure optional data source settings, such as server name.

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 a System 10 data source, specify values as follows:

Server List:  The list of servers that appear in the logon dialog box.  Separate the server names with commas.

Database Name:  The name of the database to which you want to connect by default.  If you do not specify a value, the default is the database defined by the  system administrator for each user.

Database List:  The databases that appear in the logon dialog box.  Separate the names with commas.

Default Logon ID:  The default logon ID used to connect to your System 10 database.  This ID is case-sensitive.  A logon ID is required only if security is enabled for the database you are connecting to.  Your ODBC application may override this value or you may override this value in the logon dialog box or connection string.

Interfaces File:  The pathname of the interfaces file.  The default is the normal Sybase interfaces file.

Password Encryption:  A number that determines whether password encryption can be performed from the Open Client Library to the server (PasswordEncryption=1). When set to 0, the default, this cannot be done.

Charset:  The name of a character set corresponding to a subdirectory in $SYBASE/charsets.  The default is the setting on the System 10 server.

Workstation ID:  The workstation ID used by the client.

Language:  The national language corresponding to a subdirectory in $SYBASE/locales.  The default is English.

Application Name:  The name used by System 10 to identify your application.

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 System 10 is busy.

Close

Returns to the System 10 ODBC Setup dialog box where you can click the OK button to write these settings to the ODBC.INI file.

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.

Performance

Displays the Performance dialog box to configure optional, performance settings for this data source.


ODBC Sybase System 10 Performance Setup Dialog

To configure optional, performance settings for this data source, specify values as follows:

Prepare Method:  A value that determines whether stored procedures are created on the server for every call to SQLPrepare. When set to 0, stored procedures are created for every call to SQLPrepare, which can decrease performance.

When set to 1, the initial default, the driver creates stored procedures only if the statement contains parameters. Otherwise, the statement is cached and executed directly at SQLExecute time. When set to 2, the driver never creates stored procedures.

Fetch Array Size:  The number of rows the driver retrieves from the server for each fetch.  This is not the number of rows given to the user.  The default is 10 rows.

Select Method:  A value that determines whether database cursors are used for Select statements. When set to 0 - Cursor, the initial default, database cursors are used. This setting may cause performance degradation when performing large numbers of sequential Select statements.

When set to 1 - Direct, Select statements are executed directly without using database cursors. When set to 1, the data source is limited to one active statement and one active connection. This setting may increase performance in some applications.

Packet Size:  A value that determines the number of bytes per network packet transferred from the database server to the client. The correct setting of this attribute can improve performance.

When set to 0, the initial default, the driver uses the default packet size as specified in the System 10 server configuration.

When set to -1, the driver computes the maximum allowable packet size on the first connect to the data source and saves the value in the odbc.ini file.

When set to x, an integer from 1 to 10, which indicates a multiple of 512 bytes (for example, Packet Size=6 means to set the packet size to 6 * 512 = 3072 bytes).

For you to take advantage of this connection attribute, you must configure the System 10 server for a maximum network packet size greater than or equal to the value you specified for Packet Size. For example,

sp_configure “maximum network packet size”, 5120
reconfigure
Restart System 10 Server

Note that the ODBC specification specifies a connect option, SQL_PACKET_SIZE, that offers this same functionality. To avoid conflicts with applications that may set both the connection string attribute and the ODBC connect option, they have been defined as mutually exclusive. If PacketSize is specified, you will receive a message “Driver Not Capable” if you attempt to call SQL_PACKET_SIZE. If you do not set Packet Size, then application calls to SQL_PACKET_SIZE are accepted by the driver.

Connection Cache: A value that determines the number of connections that the connection cache can hold. The default Connection Cache setting is 1. To set the connection cache, you must set the Select Method option to 1 - Direct. Increasing the connection cache may increase performance of some applications, but requires additional database resources.

Close

Returns to the Advanced Setup dialog box where you can click the OK button to write these settings to the ODBC.INI file.


Logon to Sybase System 10
Logon to System 10

Server Name:  Type the case-sensitive name of the server containing the System 10 database tables 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.

Login ID:  If required, type your Login ID (case-sensitive).

Password:  If required, type your password for the system (case-sensitive).

Database:  Type the name of the database you want to access (case-sensitive) or select the name from Database drop-down list, which displays the database names you specified in the Setup dialog box.