DBCHQE is a query facility that enables you to request system default information from the Teradata Database prior to logging on, thereby allowing you to make changes before starting a session.
The Session Character Set, which is obtained on per session basis, can be obtained only after a session has been logged on.
Parameters
DBCHQE (ReturnCode, ContextArea,DBCHQEP) | |
Int32 | *ReturnCode |
Int32 | *ContextArea |
Int32 | *DBCHQEP |
where the following is true:
The parameter... | Is the... |
---|---|
ReturnCode | four-byte address of an area allocated by the application program for storage of a four-byte signed integer. |
ContextArea | four-byte address not used by CLI. It is provided to maintain compatibility with the mainframe. |
DBCHQEP |
four-byte address of the DBCHQEP structure. Some of this structure needs to be filled in by the application program to request query information. The results of the query will then be sent back to the application in this structure. |
DBCHQEP Structure
Fields | Data Type | Description |
---|---|---|
qepLevel | unsigned char | Unassigned numeric format of the parameter list. The values supported in this field are:
|
qepItem | unsigned char | For valid item codes and their descriptions, see the The qepItem Field. |
qepTLen | unsigned short | Must be set to the TDPID length and TDPID name (dbcname) used for the query. |
qepTDP | long | Must be set to the TDPID length and TDPID name (dbcname) used for the query. |
qepRsv1[4] | char | Reserved |
qepRALen | unsigned short | Unsigned numeric length of the area in which the result of the query is returned. Supplied by caller. |
qepRDLen | unsigned short |
Unsigned numeric length of the data returned. CLI writes into this field the length of the data it returned in qepRArea. (Sets to the length of the data returned, up to the size of the area specified by the qepRALen field.) Set to the length of the data returned (up to the size of the area as specified by the qepRALen field). |
*qepRArea | void |
Pointer to the area in which the result of the query is returned. The length of this area is set by the application in qepRALen. |
qepRsv2 | unsigned short | Reserved |
qepMLen | unsigned short | Reserved |
qepMsg | char | Reserved |
qepConn | long | Session number |
qepMLid | char[2] | Specify the language to be used for any CLI error message associated with the request.
|
*qepMsgP | char | Pointer to an area into which any error message will be placed. Area is allocated by the application. |
qepMsgM | unsigned short | Unsigned numeric length, in bytes, of the area pointed to by QepMsgP. |
qepRC | unsigned short | Unsigned numeric CLI return code that occurred while processing the DBCHQEP. |
qepRMRC | unsigned short |
Unsigned numeric CLI return code for any error that occurred while constructing the message.
If two errors occur simultaneously then the result returned is a bit-wise ‘or’ of the two return codes. (for example, if langid used is default and overflow occurred while returning the message, the output will be: QEPRC = 2 | 1 = 3 |
qepRMLen | unsigned short | Unsigned numeric length, in bytes, of the message returned in the area addressed by QEPMSGP. |
The qepItem Field
qepItem must be set to a value indicating the type of request, as follows:
Fields | Value | Description |
---|---|---|
QEPIIID | 1 | Not supported |
QEPISC | 2 |
Returns the name of the default session character set. The return area must be at least 30 bytes because DBCHQE will return a 30-byte character string containing the default character set. All other requests need only a one-byte response area. Refers to the session whose CLIv2 session number is specified in the qepConn field. |
QEPIFTSM | 3 |
Transaction Semantics Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for Teradata transaction semantics. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIFLCS | 4 |
Language Conformance Returns the following values to the area pointed to by qepRArea to indicate what type of SQL is supported:
Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIFUCR | 5 |
Updatable Cursor Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for updatable cursors. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIFRFI | 6 |
Referential Integrity Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for referential integrity. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIDTSM | 7 | Returns the default transaction semantics, a one-byte character (A or T), for the identified Teradata server to the area pointed to by qepRArea. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEP64K | 8 |
64K Parcels Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for 64K parcels. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPICL2R | 9 |
Release Identifier Returns the release identifier for the CLI being used. The release identifier is an eleven-character value consisting of the two-character major release identifier, the two-character minor release identifier, and the two-character maintenance release identifier, each separated by periods. The last three characters are often blank, but if they are not, they are a period delimiter followed by the two-character E-tape identifier. The intent of the data is not to deduce CLI functionality, but simply to provide the current CLI release identification.
|
QEPISPF | 10 |
Parallelism Returns a dimensionless value that indicates the extent of parallel processing used internally by the server as a four-byte unsigned integer to the area pointed by qepRArea.
|
QEPIDMSS | 11 |
Maximum Parcel Size Returns a four-byte value that indicates the maximum size allowed for a segment supported by the server. Segments are used to subdivide special purpose requests that exceed the maximum parcel size. |
QEPITDPR | 12 |
Mainframe Compatibility This query level is for mainframe compatibility only. On workstation-attached clients, this query will result in CLI Error 354 (NOQINFO), "The requested query information is unavailable". |
QEPIFSSO | 13 |
Single Sign-On Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for single sign-on. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPISU | 14 |
Authentication Returns the actual Teradata Database username of a user logged in using single sign-on or third-party authentication mechanism (such as LDAP). Refers to the numeric session id indicated by qepConn. |
QEPIFUPS | 15 |
Atomic UPSERT Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for Atomic UPSERT. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIAOP | 16 |
Array Operations Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for ARRAY OPERATIONS. The length of qepRArea should be at least 1 byte. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIFMRG | 17 |
MERGE INTO Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for MERGE_INTO. The length of the qepRArea should be at least 1 byte. Refers to the Teradata server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIFLOB | 18 |
LOB Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for LOB support. Refers to the server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPITPR | 19 |
Timing Precision Returns the minimum and maximum values for timing-precision supported by client platform, as two signed, 2-byte fields. The QEPTDP is ignored. The length of the qepRArea should be at least 4 bytes. |
QEPIXRS | 20 |
Extended Response Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for extended message response. The length of the qepRArea should be at least 1 byte. Refers to the server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIEPU | 21 |
APH Request Returns one of the following to the area pointed to by qepRArea:
The length of the qepRArea must be at least 2 bytes. Refers to the server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIUD | 23 |
Utility-data support Refers to the server whose TDP identifier is addressed by the qepTDP field. The length of the qepRArea should be at least 4 bytes. The returned 6 byte value contains:
|
QEPIASL | 24 |
Aggregate Support List Returns a list of values that indicate support for multiple features. The list consists of 1-byte values equal to those returned by the following query items, in order:
The length of the qepRArea should be at least 29 bytes. A length of 64 bytes is recommended. Refers to the server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIRPO | 25 |
Cursor Positioning Returns 'N' or 'Y' to the area pointed to by qepRArea to indicate support for cursor positioning. The length of the qepRArea should be at least 1 byte. Refers to the server whose TDP identifier is addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIENC | 26 |
Data Encryption Returns 'N' or 'Y' to indicate whether encryption is both supported and enabled on the database server to which the session is connected. Refers to the session whose CLIv2 session number is specified in the qepConn field. |
QEPIRMR | 27 |
CLI Information Returns the CLIv2 release identifier and any customization information for the message table used for the session whose CLIv2 connection number is specified in the qepConn field and the request whose CLIv2 request number is specified in the QEPRQST field. The length of the returned information is up to 48 ASCII characters, consisting of one or two identifiers separated by a comma. |
QEPIACS | 28 |
Character Sets Returns the names of the character sets available on the server specified by the TDP identifier addressed by the qepTidp field and has length specified by the qepTlen field. The length of the response is four fixed fields followed by a variable number of character set names. Returns as many whole character set names as will fit into the response area whose length is indicated by qepRalen. If all names are not returned, one of the following queries (that specify the returned token) can be issued to indicate the processing of additional names:
|
QEPIESS | 29 | Obsolete, use QEPISSU (56) |
QEPIUDT | 30 |
UDT Returns 'Y' or 'N' to indicate support for user-defined types. |
QEPIAPH | 31 |
APH Response Returns to the area pointed to by qepRArea a numeric value or 0 to indicate support for APH responses. Refers to the TDP identifier addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIALM | 32 |
Mechanisms Returns a list of supported mechanism names:
|
QEPIDCS | 33 |
Default Character Set Returns the default character set of the database as 30 single-byte characters in the platform character set (ASCII), left-justified, and padded with blanks. The caller of DBCHQE must supply a return area with a length of at least 30 bytes. This field is not returned as a string, so the caller will need to insert a null terminator in the first blank location prior to attempting to write the field to output through print.
|
QEPIDBR | 34 |
Teradata Database Information Returns the Teradata Database release and version information in two contiguous fields using slightly different formats:
The caller of DBCHQE must supply a return area with a length of at least 62 bytes.
|
QEPIC2L | 35 |
CLI Limits Returns limits for the Teradata Database affecting an application's values for CLIv2 settings. The response consists of four fields totaling 32 bytes. The caller of DBCHQE (QEPIC2L) must supply a return area of at least 32 bytes. A structure mapping (struct QEPCLLIMIT_) is supplied in dbchqep.h for the convenience of users. |
QEPISQL | 36 |
SQL Limits Returns limits for the Teradata Database affecting an application's use of SQL statements. The response consists of 28 fields totaling 128 bytes. The caller of DBCHQE (QEPISQL) must supply a return area of at least 104 bytes. A structure mapping (struct QEPDBLIMIT_) is supplied in dbchqep.h for the convenience of users. |
QEPIRCA | 37 |
Relaxed Call Argument Returns an indicator which can be used to determine whether the target server supports the Relaxed Call Argument feature. DBCHQE will return 'Y' if server supports this feature and 'N' if it does not (using ASCII characters). The caller of DBCHQE must supply a return area with a length of at least one byte. |
QEPISIS | 38 |
StatementInformation Parcels Returns 'Y' or 'N' to indicate support of StatementInformation parcels. |
QEPIIDE | 39 |
Large Integer/Decimal Returns 'Y' or 'N' to indicate support for the Large Integer/Decimal feature. A returned value of 'Y' indicates that the server supports this feature. A returned value of 'N' or any non-zero return code indicates that the server does not support this feature. Returned values are in ASCII. QEPIIDE requires a return area of at least one byte and a target TDPid. This query item is also included in the aggregate support list. |
QEPIRID | 40 |
Defines whether data may be returned in response to an SQL Insert operation when Identity columns are involved. A returned value of 'Y' indicates that the server supports this feature. A returned value of 'N' or any non-zero return code indicates that the server does not support this feature. Returned values are in ASCII. QEPIRID requires a return area of at least one byte and a target TDPid. This query item is also included in the aggregate support list. |
QEPIDRS | 41 |
ResultSet Returns 'Y' or 'N' to indicate whether stored procedures may return the results of their SQL statements to the application. |
QEPIQBS | 42 |
Query Band Returns 'Y' or 'N' to indicate support for the SQL SET QUERY_BAND statement. |
QEPIMIU | 43 |
MERGE INTO Returns 'Y' or 'N' to indicate support for the SQL MERGE INTO statement. |
QEPILEU | 44 |
Logging Errors Returns 'Y' or 'N' to indicate support for the Teradata SQL LOGGING ERRORS clause. |
QEPIPD | 45 |
Default Connection Returns 'Y' or 'N' to indicate support for the Default Connection feature. The caller must supply a return area with a length of at least one byte. |
QEPISCS | 46 |
Session Character Set Returns the name of the session character set. The return area must be at least 30 bytes because DBCHQE returns a 30-byte character string that contains the character set. Refers to the session whose CLIv2 session number is specified in the qepConn field. |
QEPICCS | 47 |
Column Correlation Returns 'Y' or 'N' to indicate support for the Column Correlation feature. |
QEPIUS | 48 |
Utility Session Returns the following values:
An actual throughput is calculated as data/transmission time. An effective throughput is calculated as data/session time. Refers to the session whose CLIv2 session is specified in the qepConn field. Utility-session is used by proprietary Teradata utilities, and is not intended for other applications. |
QEPIDAP | 49 |
Returns the database access path A database access path is a variable-length string that contains the fully qualified domain name and its associated IP address and port number. The following possibilities are equally valid as the prefix for a logon string. Accordingly, the query result consists of one variable-length value. The port number (server side) is always returned following the machine name, FQDN, or IP address, separated by the conventional colon:
|
QEPITSS | 50 |
Trusted Sessions Returns 'Y' or 'N' to indicate support for the Trusted Sessions feature. |
QEPILNS | 51 |
LOB-Name-support Determines whether a DEFERRED LOB can be identified by name. Returns whether the BY NAME phrase is permitted in the USING row descriptor in the request string. Returns 'Y' or 'N' to indicate support for the LOB-Name-support feature |
QEPITOU | 52 |
UDT-TransformsOff-support The caller of DBCHQE (QEPITOU) must supply a return area of at least two bytes and a target TDPid. The returned value containing one of the following values:
|
QEPITRS | 53 |
Trusted-request-support Defines whether the database supports trusted sessions enhancement for the trusted-request option. A returned value of 'Y' indicates that the server supports this feature. A returned value of 'N' or any non-zero return code indicates that the server does not support this feature. The caller of DBCHQE (QEPITRS) must supply a return area of one byte and a target TDPid. This query item is not included in the aggregate support list. |
QEPIBI | 54 |
Build-information Returns a list of six values that indicate support for multiple features. The list consists of 1-byte values equal to those returned by the following query items, in order:
A returned value of 'Y' indicates that the server supports this feature. A returned value of 'N' or any non-zero return code indicates that the server does not support this feature. The caller of DBCHQE(QEPIBI) must supply a return area of at least six bytes. Refers to the session whose CLIv2 session number is specified in the qepConn field. |
QEPISES | 55 |
Statement-Independence-support Defines whether DBS supports Statement Independence feature. A returned value of 'Y' indicates that the server supports this feature. A returned value of 'N' or any non-zero return code indicates that the server does not support this feature. The caller of DBCHQE (QEPISES) must supply a return area of one byte and a target TDPid. This query item is not included in the aggregate support list. |
QEPISSU | 56 |
Enhanced Statement Status level support Returns a byte indicating ESS level support. The length of the qepRArea should be at least 1 byte. Refers to the TDP identifier addressed by the qepTDP field and has length specified by the qepTLen field. |
QEPIILB | 57 |
SLOB support The length of the response is six bytes as follows:
|
QEPIUPT | 58 |
Unicode Pass Through Refers to the server whose TDP identifier is addressed by the qepTDP field. The length of the qepRArea should be at least 2 bytes. The returned 2 byte value contains:
|
QEPISTT | 60 |
Transform Group for Type support The length of the qepRArea should be at least 2 bytes. The returned 2 byte value contains:
Refers to the server whose TDP identifier addressed by the qepTDP field and has length specified by the qepTLen field. |
CLIv2-limits
An application can use CLIv2-limits to choose CLIv2 settings to optimize its execution for the accessed Teradata Database, or to prevent errors caused by exceeding limits. Return limits for the Teradata Database affect an application's values for CLIv2 settings. The response consists of four fields totaling 32 bytes.
Item Code | Mnemonic | DBQERC2L (DbqerC2L for C) | |
---|---|---|---|
Fields | Value | ||
35 | QEPIC2L |
|
|
SQL-limits
An application can use SQL-limits to construct SQL statements to optimize its execution for the accessed Teradata Database, or to prevent errors caused by exceeding limits.
Return limits for the Teradata Database affect an application's use of SQL statements. The response consists of 28 fields totaling 128 bytes.
Item Code | Mnemonic | DBQERSQL (DbqerSQL for C) | |
---|---|---|---|
Fields | Value | ||
36 | QEPISQL |
|
|