Querying and setting processing values

Table 3-8 shows global variables and set statements used to query and set processing values for the client connection.

Table 3-8: 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 DB2 access service.

select @@DefaultedRowCount

No set statement

Returns the number of rows the DB2 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 @@MainframeVersion

No set statement

Returns the version of MainframeConnect for DB2.

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 DB2 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 DB2 access service to the normal mode of returning result sets.

select @@RejectedRowCount

No set statement

Returns the number of rows rejected by the DB2 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 DB2 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.