Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Types [Table of Contents] Chapter 3 Routines

Open Client Client-Library/C Reference Manual

[-] Chapter 2 Topics
[-] Using the runtime configuration file

Using the runtime configuration file

By default, Client-Library reads the Open Client/Server runtime configuration file to set runtime values for the following:

Applications that read the configuration file to apply these settings eliminate several calls to ct_con_props or the other routines mentioned above. Another benefit is that the application's runtime settings are changed without recompiling code.

If there is an external Sybase configuration file, add these sections to enable bcp and isql: [BCP][CTISQL]

Enabling debugging

Table 2-33 lists the keywords for configuring the debugging options for a connection.

Configuration file keywords for debugging options

Keyword

Value

CS_DBG_FILE

A character string specifying the destination file name for text-format debugging information.

CS_PROTOCOL_FILE

A character string specifying the destination file name for binary format debugging information.

CS_DEBUG

A character string giving a comma-separated list of debug flags.

CS_DEBUG specifies the data to be written to the file CS_DBG_FILE. Its value can be a list of flags that correspond to the bitmasks for ct_debug's flag parameter. For meanings of these debug flags, see the reference page for ct_debug.

The possible flags are:

Enabling external configuration

The following properties control the use of the Open Client/Server runtime configuration file:

Open Client/Server runtime configuration file syntax

The Open Client/Server runtime configuration file is a text file. The file is separated into sections, each of which begins with a section name enclosed in square brackets ([]) and ends with the next section name or the end of the file, whichever appears first.

Each section contains one or more settings, as illustrated below:

[section name]
 keyword = value ; comment
 keyword = value
; more comments
[next section name]
... and so forth ...

In general, all supported keywords in the file match the names of the symbolic constants that would identify the property, option, or capability in a Client-Library/C program. However, not all properties can be set in the configuration file. If a keyword is not supported, the setting is ignored.

Legal values adhere to the following rules:

If a keyword occurs twice in a section, only the first definition is used.

A section can include the keywords in another section using this syntax:

[section
name]
 include = previous
section name
... more settings ...

All settings defined under an included section name are defined in a section that includes that section. An included setting is always replaced by an explicit setting in the including section. For example, the Finance section, below, defines CS_TIMEOUT as 30. The included setting from the DEFAULT section is replaced by an explicit setting:

[DEFAULT]
 CS_TIMEOUT = 45
 
 [Finance]
 include = DEFAULT
 CS_TIMEOUT = 30

Runtime configuration file keywords

The tables below contain the legal keywords for configuring Client-Library's runtime behavior and the recognized values for each.

Keywords for localization

The following table describes the keywords for configuring a context or a connection's locale. These settings replace calls necessary to set the CS_LOC_PROP property for a context or connection.

Keyword

Legal value

CS_LOCALE

Any locale name defined in the locales file for the host platform.

Keywords for context or connection properties

When the application calls them, ct_init and ct_connect each read a section of the configuration file if the application has requested external configuration.

If a context property is set when ct_init reads a section, then any calls to ct_con_props to set the same property override the configured setting.

If a property is set when ct_connect reads a section, then calls to ct_con_props to set the same property either:

For example, values for CS_USERNAME and CS_PASSWORD that are set in a configuration section always override hard-coded values in the application code. This is true because the application must set these properties before ct_connect is called.

The following table lists the keywords that set context or connection properties. For descriptions of what each property controls, see "Properties".

Configuration file keywords to set properties

Keyword

Read by

Legal value

CS_ANSI_BINDS

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_APPNAME

ct_connect

A character string

CS_ASYNC_ NOTIFS

ct_connect

CS_TRUE or CS_FALSE

CS_BULK_LOGIN

ct_connect

CS_TRUE or CS_FALSE

CS_CON_KEEPALIVE

ct_connect

CS_TRUE or CS_FALSE

CS_CON_TCP_NODELAY

ct_connect

CS_TRUE or CS_FALSE

CS_DIAG_TIMEOUT

ct_connect

CS_TRUE or CS_FALSE

CS_DISABLE_POLL

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_DS_COPY

ct_connect

CS_TRUE or CS_FALSE

CS_DS_DITBASE

ct_connect

A character string

CS_DS_FAILOVER

ct_connect

CS_TRUE or CS_FALSE

CS_DS_PASSWORD

ct_connect

A character string

CS_DS_PRINCIPAL

ct_connect

A character string

CS_DS_PROVIDER

ct_connect

A character string

CS_EXPOSE_FMTS

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_EXTRA_INF

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_HAFAILOVER

ct_config, ct_con_props

CS_TRUE or CS_FALSE

CS_HIDDEN_KEYS

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_HOSTNAME

ct_connect

A character string

CS_IFILE

ct_init

A character string

CS_LOGIN_TIMEOUT

ct_init

An integer value

CS_LOOP_DELAY

ct_connect

An integer value

CS_MAX_CONNECT

ct_init

An integer value

CS_NETIO

ct_init, ct_connect

CS_SYNC_IO, CS_ASYNC_IO, or CS_DEFER_IO

CS_NOAPI_CHK

ct_init

CS_TRUE or CS_FALSE

CS_NO_TRUNCATE

ct_init

CS_TRUE or CS_FALSE

CS_NOINTERRUPT

ct_init

CS_TRUE or CS_FALSE

CS_PACKETSIZE

ct_connect

An integer value

CS_PASSWORD

ct_connect

A character string

CS_RETRY_COUNT

ct_connect

An integer value

CS_SEC_APPDEFINED

ct_connect

CS_TRUE or CS_FALSE

CS_SEC_CHALLENGE

ct_connect

CS_TRUE or CS_FALSE

CS_SEC_CHANBIND

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_CONFIDENTIALITY

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_CREDTIMEOUT

ct_init, ct_connect

A positive integer or CS_NO_LIMIT

CS_SEC_DATAORIGIN

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_DELEGATION

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_DETECTREPLAY

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_DETECTSEQ

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_ENCRYPTION

ct_connect

CS_TRUE or CS_FALSE

CS_SEC_INTEGRITY

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_KEYTAB

ct_connect

A character string

CS_SEC_MECHANISM

ct_init, ct_connect

A character string

CS_SEC_MUTUALAUTH

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_NETWORKAUTH

ct_init, ct_connect

CS_TRUE or CS_FALSE

CS_SEC_SERVERPRINCIPAL

ct_connect

A character string

CS_SEC_SESSTIMEOUT

ct_init, ct_connect

A positive integer or CS_NO_LIMIT.

CS_TDS_VERSION

ct_connect

CS_TDS_40, CS_TDS_42, CS_TDS_46, or CS_TDS_50

CS_TEXTLIMIT

ct_init, ct_connect

An integer value or CS_NO_LIMIT

CS_TIMEOUT

ct_init

An integer value

CS_USERNAME

ct_connect

A string value

Keywords for server options

Table 2-35 lists the keywords for configuring the server options for a connection.

Application calls to ct_options always override equivalent settings in the configuration file.

The keywords for setting server options are listed below. For descriptions of what each option controls, see "Options".

Configuration file keywords for server options

Keyword

Legal value

CS_OPT_ANSINULL

CS_TRUE or CS_FALSE

CS_OPT_ANSIPERM

CS_TRUE or CS_FALSE

CS_OPT_ARITHABORT

CS_TRUE or CS_FALSE

CS_OPT_ARITHIGNORE

CS_TRUE or CS_FALSE

CS_OPT_AUTHOFF

A string value

CS_OPT_AUTHON

A string value

CS_OPT_CHAINXACTS

CS_TRUE or CS_FALSE

CS_OPT_CURCLOSEONXACT

CS_TRUE or CS_FALSE

CS_OPT_CURREAD

A string valu.

CS_OPT_CURWRITE

A string value

CS_OPT_DATEFIRST

CS_OPT_SUNDAY, CS_OPT_MONDAY, CS_OPT_TUESDAY, CS_OPT_WEDNESDAY, CS_OPT_THURSDAY, CS_OPT_FRIDAY, or CS_OPT_SATURDAY

CS_OPT_DATEFORMAT

CS_OPT_FMTMDY, CS_OPT_FMTDMY, CS_OPT_FMTYMD, CS_OPT_FMTYDM, CS_OPT_FMTMYD, or CS_OPT_FMTDYM

CS_OPT_FIPSFLAG

CS_TRUE or CS_FALSE

CS_OPT_FORCEPLAN

CS_TRUE or CS_FALSE

CS_OPT_FORMATONLY

CS_TRUE or CS_FALSE

CS_OPT_GETDATA

CS_TRUE or CS_FALSE

CS_OPT_IDENTITYOFF

A string value

CS_OPT_IDENTITYON

A string value

CS_OPT_ISOLATION

CS_OPT_LEVEL0, CS_OPT_LEVEL1, or CS_OPT_LEVEL3

CS_OPT_NOCOUNT

CS_TRUE or CS_FALSE

CS_OPT_NOEXEC

CS_TRUE or CS_FALSE

CS_OPT_PARSEONLY

CS_TRUE or CS_FALSE

CS_OPT_QUOTED_IDENT

CS_TRUE or CS_FALSE

CS_OPT_RESTREES

CS_TRUE or CS_FALSE

CS_OPT_ROWCOUNT

An integer value

CS_OPT_SHOWPLAN

CS_TRUE or CS_FALSE

CS_OPT_SORTMERGE

CS_TRUE or CS_FALSE

CS_OPT_STATS_IO

CS_TRUE or CS_FALSE

CS_OPT_STATS_TIME

CS_TRUE or CS_FALSE

CS_OPT_TEXTSIZE

An integer value

CS_OPT_TRUNCIGNORE

CS_TRUE or CS_FALSE

Keywords for server capabilities

Only response capabilities are configured externally. If response capabilities are read from the file, they replace any response capabilities set by application calls to ct_capability for the connection.

The following table lists the keywords for configuring the server capabilities for a connection. For descriptions of what each capability controls, see the reference page for ct_capability.

Keyword

Legal value

CS_CAP_RESPONSE

A comma-separated list of capabilities the client does not want to receive. List values include any symbolic constant listed in Table 3-6.

Keywords for ct_debug options

The following table lists the keywords for configuring the debugging options for a connection.

The CS_DBG_FILE keyword specifies the name of the file to which Client-Library writes text-format debug information. Client-Library only records the debug information that is requested.

Debug information is requested with the other keywords. These correspond to the bitmasks for the ct_debug flag parameter. For meanings of these debug flags, see the reference page for ct_debug.

Configuration file keywords for debugging options

Keyword

Legal value

CS_DBG_FILE

A character string specifying the file name for text-format debugging information

CS_DEBUG

A character string giving a comma-delimited list of debug flags

CS_PROTOCOL_FILE

A character string specifying the destination file name for binary-format debugging information

CS_DEBUG specifies the data to be written to the file CS_DBG_FILE. Its value can be a list of flags that correspond to the bitmasks for ct_debug's flag parameter. For meanings of these debug flags, see the reference page for ct_debug in the Open Client Client-Library/C Reference Manual.

The possible flags are:


Types [Table of Contents] Chapter 3 Routines