![]() | ![]() |
Home |
|
|
Access Service User's Guide DirectConnect Anywhere |
|
| Chapter 3 Querying and Setting Operating Values |
Chapter 3
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:
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:
The current value of a set statement
Information about the processing state of a connection
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:
All global variables can be queried regardless of the SQL transformation mode in effect for the connection.
The select statement must be the only one in a batch.
The statement can be terminated with a semicolon.
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 } valuewhere:
property_name is the name of the configuration property.
processing_name is the name of the processing option.
value is a valid value for the configuration property.
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"
The following table shows access service required properties with associated global variables and set statements.
Configuration Property | Global Variable and set Statement |
DefaultClientCodeset | select @@DefaultClientCodeset set DefaultClientCodeset clientcodeset |
DefaultTargetCodeset | select @@DefaultTargetCodeset set DefaultTargetCodeset targetcodeset |
The following table shows CSP properties with associated global variables and set statements.
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} |
The following table shows client interaction properties with associated global variables and set statements.
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 |
The following table shows data conversion error properties with associated global variables and set statements.
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} |
The following table shows datatype conversion properties with associated global variables and set statements.
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} |
The following table shows target interaction properties with associated global variables and set statements.
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 |
The following table shows transfer properties with associated global variables and set statements.
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 |
The following table shows global variables and set statements that query and set processing values for the client connection.
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:
|
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:
|
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. |
|
|