16.20 - SQL-limits - Teradata Tools and Utilities

Teradata® Call-Level Interface Version 2 Reference for Mainframe-Attached Systems

prodname
Teradata Tools and Utilities
vrm_release
16.20
created_date
September 2019
category
Programming Reference
featnum
B035-2417-108K

The SQL-limits might be used either to construct SQL statements to optimize its execution for the accessed Teradata Database or to prevent errors caused by exceeding limits.

Refers to the Teradata Database associated with the TDP whose TDP identifier is addressed by the QEPTIDP field and has length specified by the QEPTLEN field. Since they do not apply, the QEPRQST and QEPTOKEN fields must contain binary zeroes.

Returns limits for the Teradata Database affecting an application's use of SQL statements. The response consists of twenty-nine field totaling one hundred thirty-two bytes.

Item Code Mnemonic ResponseDBQERSQL (DbqerSQL for C)
Fields Value
36 QEPISQL QERSQLRL ('rowLen' for C, ROW-LEN for COBOL, ROW_LEN for PL/I)

An eight-byte unsigned integer is the number of usable bytes in a Database table row.

In C compilers not supporting 64bit integers, an array named 'rowLenHalf' consisting of two four-byte unsigned integers, each containing four bytes of the value, is used.

    QERSQLLL ('lobLen' for C, LOB-LEN for COBOL, LOB_LEN for PL/I)

An eight-byte unsigned integer is the maximum number of bytes for a large object, either a binary or character object.

In C compilers not supporting 64bit integers, an array named 'lobLenHalf' consisting of two four-byte unsigned integers, each containing four bytes of the value, is used.

    QERSQLNL ('nameCharlen' for C, NAME-CHARLEN for COBOL, NAME_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of single-byte characters in a Teradata name (such as a userid, table name, column name). The presence of multi-byte characters will correspondingly lower the effective maximum.
    QERSQLKT ('tableColumns' for C, TABLE-COLUMNS for COBOL, TABLE_COLUMNS for PL/I) A four-byte unsigned integer is the maximum number of columns in a table.
    QERSQLTS ('selectTables' for C, SELECT-TABLES for COBOL, SELECT_TABLES for PL/I) A four-byte unsigned integer is the maximum number of tables that may be specified in a SELECT statement.
    QERSQLKS ('expressionColumns' for C, EXPRESSION-COLUMNS for COBOL, EXPRESSION_COLUMNS for PL/I) A four-byte unsigned integer is the maximum number of columns that may be specified in a SELECT statement expression.
    QERSQLKG ('groupbyColumns' for C, GROUPBY-COLUMNS for COBOL, GROUPBY_COLUMNS for PL/I) A four-byte unsigned integer is the maximum number of columns that may be specified in a GROUPBY SQL clause.
    QERSQLKO ('orderbyColumns' for C, ORDERBY-COLUMNS for COBOL, ORDERBY_COLUMNS for PL/I) A four-byte unsigned integer is the maximum number of columns that may be specified in a ORDERBY SQL clause.
    QERSQLLC ('charLitCharlen' for C, CHAR-LIT-CHARLEN for COBOL, CHAR_LIT_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of single-byte characters for a CHARACTER literal (a string of characters enclosed by apostrophes). The presence of multi-byte characters will correspondingly lower the effective maximum.
    QERSQLLH ('hexLitCharlen' for C, HEX-LIT-CHARLEN for COBOL, HEX_LIT_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of single-byte characters for a HEXADECIMAL literal (a string of hexadecimal characters enclosed by apostrophes and followed by at least the letter X). The presence of multi-byte characters will correspondingly lower the effective maximum.
    QERSQLKL ('columnLen' for C, COLUMN-LEN 
for COBOL, COLUMN_LEN for PL/I) A four-byte unsigned integer is the maximum number of bytes for a column.
    QERSQLC ('charCharlen' for C, CHAR-CHARLEN for COBOL, CHAR_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of single-byte characters in a column of data type CHARACTER. The presence of multi-byte characters will correspondingly lower the effective maximum.
    QERSQLVC ('varcharCharlen' for C, VARCHAR-CHARLEN for COBOL, VARCHAR_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of single-byte characters in a column of data type VARCHAR. The presence of multi-byte characters will correspondingly lower the effective maximum.
    QERSQLG ('graphicCharlen' for C, GRAPHIC-CHARLEN for COBOL, GRAPHIC_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of two-byte characters in a column of data type GRAPHIC.
    QERSQLVG ('vargraphicCharlen' for C, VARGRAPHIC-CHARLEN for COBOL, VARGRAPHIC_CHARLEN for PL/I) A four-byte unsigned integer is the maximum number of two-byte characters in a column of data type VARGRAPHIC.
    QERSQLB ('byteLen' for C, BYTE-LEN for COBOL, BYTE_LEN for PL/I) A four-byte unsigned integer is the maximum number of bytes in a column of data type BYTE.
    QERSQLVB ('varbyteLen' for C, VARBYTE-LEN for COBOL, VARBYTE_LEN for PL/I) A four-byte unsigned integer is the maximum number of bytes in a column of data type VARBYTE.
    QERSQLPD ('decimalPrecision' for C, DECIMAL-PRECISION for COBOL, DECIMAL_PRECISION for PL/I) A four-byte unsigned integer is the maximum precision (number of digits) in a column of data type DECIMAL or NUMERIC.
    QERSQLET ('timeScale' for C, TIME-SCALE for COBOL, TIME_SCALE for PL/I) A four-byte unsigned integer is the maximum scale (number of digits to the right of the decimal point; sometimes referred to as the fractionalized precision) in a column of data type TIME [WITH TIME ZONE].
    QERSQLEP ('timestampScale' for C, TIMESTAMP-SCALE for COBOL, TIMESTAMP_SCALE for PL/I) A four-byte unsigned integer is the maximum scale (number of digits to the right of the decimal point; sometimes referred to as the fractionalized precision) in a column of data type TIMESTAMP [WITH TIME ZONE].
    QERSQLES ('intervalSecondScale' for C, INTERVAL-SECOND-SCALE for COBOL, INTERVAL_SECOND_SCALE for PL/I) A four-byte unsigned integer is the maximum scale (number of digits to the right of the decimal point; sometimes referred to as the fractionalized precision) in a column of data type INTERVAL DAY TO SECOND, INTERVAL HOUR TO SECOND, INTERVAL MINUTE TO SECOND, or INTERVAL SECOND.
    QERSQLUN ('usingValues' for C, USING-VALUES for COBOL, USING_VALUES for PL/I) A four-byte unsigned integer is the maximum number Teradata SQL USING row descriptor fields.
    QERSQLPQ ('requestParms' for C, REQUEST-PARMS for COBOL, REQUEST_PARMS for PL/I) A four-byte unsigned integer is the maximum number of variable names in a Teradata/SQL parameterized query request.
    QERSQLPP ('procedureParms' for C, PROCEDURE-PARMS for COBOL, PROCEDURE_PARMS for PL/I) A four-byte unsigned integer is the maximum number of parameters to a stored procedure.
    QERSQLEN ('elicitNameLen' for C, ELICIT-NAME-LEN for COBOL, ELICIT_NAME_LEN for PL/I) A four-byte unsigned integer is the maximum number of bytes that may be specified by the Using-data field for AS DEFERRED BY NAME phrase. If the length is not available, a value of zero is returned (and 1024 can be assumed).
    QERSQLQT

MAX-REQUEST-TEXT-LEN for COBOL, maxRequestTextLen for C, MAX_REQUEST_TEXT_LEN for PL/I

A four byte unsigned integer value that contains the maximum Request Text Length.
    QERSQLJS ('JSON-LEN' for COBOL, JSONLen' for C, JSON_LEN' for PL/I)

An eight-byte unsigned integer is the maximum length of a JavaScript Object Notation object).

In C compilers not supporting 64-bit integers, an array named JSONLenHalf' consisting of two four-byte unsigned integers, each containing four bytes of the value, is used.

    QERSQLPL ('responseRowLen' for C, RESPONSE-ROW-LEN for COBOL, RESPONSE_ROW_LEN for PL/I)

An eight byte unsigned integer is the maximum number of bytes that may be returned in a row. If the length is not available, a value of zero is returned.

In C compilers not supporting 64-bit integers, an array named 'responseRowLenHalf' consisting of two four-byte unsigned integers, each containing four bytes of the value, is used.

    QERSQLIC

ITERATION-COUNT for COBOL, iterationCount for C, ITERATION_COUNT for PL/I

A four byte unsigned integer value that contains the Iteration Count. This is the maximum number of data records per using row array. The DBCAREA field Using-data-count should not exceed this value.