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

Chapter 2 Configuring

the DirectConnect Access Service Library [Table of Contents] Chapter 4 Converting

datatypes

Access Service User's Guide DirectConnect Anywhere

[-] Chapter 3 Querying and Setting Operating Values

Chapter 3

Querying and Setting Operating Values

This chapter describes how to use global variables and set statements to query and set operating values for your client connection.

This chapter covers the following topics:

Querying Global Variables

A user or client application can query a global variable to find the property and processing values that affect that client connection.

A global variable represents one of the following:

Global variables are preceded by two "@@" characters and are not case sensitive. To query a global variable, issue a SQL statement in the form:

select @@variable_name

where variable_name is the name of the relevant global variable.

Other rules that apply are as follows:

Issuing set Statements

A user or client application can issue a set statement to change values that affect only the current client connection. These values remain in effect only for the duration of the client connection or until another set statement is issued.

Access service set statements are not case sensitive. To set an access service configuration property value or processing value for the current connection, issue a set statement as follows:

set { property_name | processing_name } value

where:

Querying and Setting Configuration Properties

Some configuration property values can be queried or set using global variables and set statements. These properties are listed by category in the following pages.

For explanations of the configuration properties, see Chapter 2, "Configuring the DirectConnect Access Service Library"

ACS Required Properties

The following table shows access service required properties with associated global variables and set statements.

Access service required properties

Configuration Property

Global Variable and set Statement

DefaultClientCodeset

select @@DefaultClientCodeset

set DefaultClientCodeset clientcodeset

DefaultTargetCodeset

select @@DefaultTargetCodeset

set DefaultTargetCodeset targetcodeset

Catalog Stored Procedures Properties

The following table shows CSP properties with associated global variables and set statements.

Catalog stored procedures properties

Configuration Property

Global Variable and set Statement

CSPExclusions

select @@CSPExclusions

set CSPExclusions {none | user | nonauth | nonauthpublic}

CSPIncludeAlias

select @@CSPIncludeAlias

set CSPIncludeAlias {no | yes}

CSPIncludeSynonym

select @@CSPIncludeSynonym

set CSPIncludeSynonym {no | yes}

CSPIncludeSystem

select @@CSPIncludeSystem

set CSPIncludeSystem {no | yes}

CSPIncludeTable

select @@CSPIncludeTable

set CSPIncludeTable {yes | no}

CSPIncludeView

select @@CSPIncludeView

set CSPIncludeView {yes | no}

DatatypeInfo

select @@DatatypeInfo

set DatatypeInfo {transact | target}

Client Interaction Properties

The following table shows client interaction properties with associated global variables and set statements.

Client interaction properties

Configuration Property

Global Variable and set statement

ClientDecimalSeparator

select @@ClientDecimalSeparator

set ClientDecimalSeparator char

MaxResultSize

select @@MaxResultSize

set MaxResultSize integer

MaxRowsReturned

select @@MaxRowsReturned

set MaxRowsReturned integer

MaxSvcConnections

select @@MaxSvcConnections

No set statement

SendWarningMessages

select @@SendWarningMessages

set SendWarningMessages {no | yes}

ServiceDescription

select @@ServiceDescription

No set statement

SvclibDescription

select @@SvclibDescription (applies to the access service library as a whole)

No set statement

TextSize

select @@TextSize

set TextSize integer

TransactionMode

select @@TransactionMode

set TransactionMode {short | long}

Version

select @@Version

No set statement

Data Conversion Error Properties

The following table shows data conversion error properties with associated global variables and set statements.

Data conversion error properties

Configuration Property

Global Variable and set Statement

CharConvertError

select @@CharConvertError

set CharConvertError {reject | truncate}

DateTimeConvertError

select @@DateTimeConvertError

set DateTimeConvertError {reject | null | default}

NumConvertError

select @@NumConvertError

set NumConvertError {reject | null | default}

Datatype Conversion Properties

The following table shows datatype conversion properties with associated global variables and set statements.

Datatype conversion properties

Configuration Property

Global Variable and set Statement

BinaryResults

select @@BinaryResults

set BinaryResults {binary | char}

DateResults

select @@DateResults

set DateResults {datetime | datetime4 | char_iso | char_usa | char_eur | char_jis | char_odbc}

DateTimeResults

select @@DateTimeResults

set DateTimeResults {datetime | datetime4 | char_iso | char_usa | char_eur | char_jis | char_odbc}

DecimalResults

select @@DecimalResults

set DecimalResults {autoconvert | int | float | real | char | money | money4 | bcd}

FloatResults

select @@FloatResults

set FloatResults {float | real | char}

Int2Results

select @@Int2Results

set Int2Results {smallint | char}

Int4Results

select @@Int4Results

set Int4Results {int | char}

RealResults

select @@RealResults

set RealResults {float | real | char}

TimeResults

select @@TimeResults

set TimeResults {datetime | datetime4 | char_iso | char_usa | char_eur | char_jis | char_odbc}

Target Interaction Properties

The following table shows target interaction properties with associated global variables and set statements.

Target interaction properties

Configuration Property

Global Variable and set Statement

Allocate

select @@Allocate

set Allocate {connect | request}

DelimitSQLRequests

select @@DelimitSQL Requests

set DelimitSQLRequests {no | yes}

IsolationLevel

select @@IsolationLevel

No set statement

SQLTransformation

select @@SQLTransformation

set SQLTransformation {passthrough | sybase}Also accepts {tsql0 | tsql1 | tsql2}

SQLOdbcCursors

select @@SQLOdbcCursors

set SQLOdbcCursors {if-needed | odbc | driver | default}

QoutedStringDelimeter

select @@QoutedStringDelimeter

set QoutedStringDelimeter any character

StopCondition

select @@StopCondition

set StopCondition {error | none | warning}

TargetDecimalSeparator

select @@TargetDecimalSeparator

No set statement

Transfer Properties

The following table shows transfer properties with associated global variables and set statements.

Transfer properties

Configuration Property

Global Variable and set Statement

BulkCommitCount

select @@BulkCommitCount

set BulkCommitCount integer

TransferBatch

select @@TransferBatch

set TransferBatch integer

TransferErrorCount

select @@TransferErrorCount

set TransferErrorCount integer

Querying and Setting Processing Values

The following table shows global variables and set statements that query and set processing values for the client connection.

Global variables and set statements for processing values

Global Variable and set Statement

Description

select @@AllResults

set AllResults {autoconvert | char}

Returns group datatype conversions. The default is autoconvert.

Sets group datatype conversions as follows:

  • autoconvert sets all datatype conversions to the default values

  • char sets all datatype conversions to CS_CHAR

select @@CloseOnEndtran

set CloseOnEndtran {on | off}

Returns current value of the set statement. The default is on.

This global variable has no effect on the state of the cursors when a transaction ends.

select @@Connections

No set statement

Returns the current number of connections to this access service.

select @@DefaultedRowCount

No set statement

Returns the number of rows the access service returned with default values substituted for data conversion errors.

select @@Error

No set statement

Reflects the message number of the last DirectConnect error. The default is 0.

select @@noexec

set noexec {on | off}

Returns noexec value. The default is off.

Allows client data to get metadata for a select statement result set as follows:

  • on causes no results rows to return, but result set metadata is available

  • off returns the access service to the normal mode of returning result sets

select @@RejectedRowCount

No set statement

Returns the number of rows rejected by the access service due to data conversion errors.

select @@RowCount

No set statement

Returns the number of rows affected by the last SQL statement processed.

select @@ServiceName

No set statement

Returns this access service name.

select @@spid

No set statement

Returns the identifier for the current client connection.

select @@TargetError

No set statement

Returns the message number of the last target database error.


Transfer

properties [Table of Contents] Chapter 4 Converting

datatypes