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 for AS/400

[-] 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. The topics covered include:

Querying global variables

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

A global variable represents one of the following:

Global variables are preceded by two "at" (@@) symbols and are not case sensitive. To query a global variable, issue a SQL select statement in the following form:

select @@variable_name

where variable_name is the name of the relevant global variable.

The access service returns the configuration property value or the processing information for the current connection. For example, the SQL statement select @@Allocate returns the Allocate configuration property value of either connect or request.

For convenience and ease-of-use, we recommend you use DirectConnect Manager to configure the access service library.

Other guidelines for querying global variables are as follows:

Issuing set Statements

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

To set an access service configuration property value or processing value for the current connection, issue a set statement in the form:

set { property_name | processing_name } value

where:

For example, the statement set Allocate request sets the Allocate configuration property value to request.

The following guidelines apply to issuing set statements:

Querying and setting properties

Some configuration property values can be queried or set using global variables and set statements. These properties appear grouped by category in the following sections:

Configuration properties, global variables, and set statements are not case sensitive.

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

Access service (ACS) required properties

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

Access service required properties

Configuration Property

Global Variable and set Statement

DefaultClientCodeset

select @@DefaultClientCodeset

set DefaultClientCodeset codeset

DefaultTargetCodeset

select @@DefaultTargetCodeset

No set statement

Target interaction properties

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

Target interaction properties

Configuration Property

Global Variable and set Statement

Allocate

select @@Allocate

set Allocate {connect | request}

IsolationLevel

select @@IsolationLevel

No set statement

SQLTransformation

select @@SQLTransformation

set SQLTransformation {passthrough | sybase}

StopCondition

select @@StopCondition

set StopCondition {error | none | warning}

TargetDecimalSeparator

select @@TargetDecimalSeparator

No set statement

Catalog stored procedure properties

The following table shows catalog stored procedure (CSP) properties and associated global variables and set statements.

Catalog Stored Procedures properties

Configuration Property

Global Variable and set Statement

CSPCatalogQualifier

select @@CSPCatalogQualifier

set CSPCatalogQualifier catalogqualifier

CSPDBName

select @@CSPDBName

set CSPDBName {NULL | dbname}

CSPIncludeSystem

select @@CSPIncludeSystem

set CSPIncludeSystem {no | yes}

CSPIncludeTable

select @@CSPIncludeTable

set CSPIncludeTable {yes | no}

CSPIncludeView

select @@CSPIncludeView

set CSPIncludeView {yes | no}

CSPQualByDBName

select @@CSPQualByDBName

set CSPQualByDBName {no | yes}

DatatypeInfo

select @@DatatypeInfo

set DatatypeInfo {transact | target}

Client interaction properties

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

Client interaction properties

Configuration Property

Global Variable and set Statement

ClientDecimalSeparator

select @@ClientDecimalSeparator

set ClientDecimalSeparator char

GatewayCompatible

select @@GatewayCompatible

No set statement

MaxResultSize

select @@MaxResultSize

set MaxResultSize integer

MaxRowsReturned

select @@MaxRowsReturned

set MaxRowsReturned integer

MaxSvcConnections

select @@MaxSvcConnections

No set statement

quoted_identifier

select @@quoted_identifier

set quoted_identifier {on| off}

SendWarningMessages

select @@SendWarningMessages

set SendWarningMessages {no | yes}

ServiceDescription

select @@ServiceDescription

No set statement

SvclibDescription

select @@SvclibDescription (This global variable 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

Returns the current version string in effect. To find the default version, see sp_helpserver .

Datatype conversion properties

The following table shows datatype conversion properties and 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_eur | char_iso | char_jis | char_usa}

DateTimeResults

select @@DateTimeResults

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

DecimalResults

select @@DecimalResults

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

FloatResults

select @@FloatResults

set FloatResults {float | real | char}

GraphicResults

select @@GraphicResults

set GraphicResults {binary | 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_eur | char_iso | char_jis | char_usa}

Data conversion error properties

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

Data conversion errors 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}

Transfer properties

The following table shows transfer properties and 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 used to 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.

Sets group datatype conversions:

  • autoconvert sets all datatype conversions to the default values.

  • char sets all datatype conversions to CS_CHAR.

select @@CloseOnEndtran

set CloseOnEndtran {on | off}

Returns how cursors behave when a commit is executed.

Determines how cursors behave when a commit is executed:

  • on (the default) causes all cursors to be closed.

  • off causes cursors to remain open at their positions when the commit is executed.

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 each event. A successful event returns a 0 (zero).

select @@noexec

set noexec {on | off}

Returns whether metadata are returned for a select statement result set.

Determines whether metadata are returned for a select statement result set:

  • on sets the access service to handle subsequent select statements such that no results rows are returned, but result set metadata are available.

  • off (the default) 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 a unique positive integer identifier (server process ID) for the current client connection.

select @@TargetError

No set statement

Returns the message number of the last target database error.


Access
service Tracing properties [Table of Contents] Chapter 4 Converting datatypes