JSON Object | Teradata Query Service - JSON Object - Teradata Query Service

Teradata® Query Service Installation, Configuration, and Usage Guide for Customers

Product
Teradata Query Service
Release Number
4.01.03.01
Published
April 2022
Language
English (United States)
Last Update
2022-06-20
dita:mapPath
xnt1648539781334.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2700
Product Category
Analytical Ecosystem

The JSON object format creates one JSON object per row where the column name is the field name and the column value is the field value. The JSON object is the default result format.

The following is an example of a JSON object response to SELECT * FROM DBC.DBCInfo:
{
    "queryDuration": 45, 
    "queueDuration": 3, 
    "results": [
        {
            "data": [
                {
                    "InfoData": "15.00.00.01", 
                    "InfoKey": "VERSION"
                }, 
                {
                    "InfoData": "Japanese", 
                    "InfoKey": "LANGUAGE SUPPORT MODE"
                }, 
                {
                    "InfoData": "15.00.00.01", 
                    "InfoKey": "RELEASE"
                }
            ], 
            "resultSet": true, 
            "rowCount": 3, 
            "rowLimitExceeded": false
        }
    ]
}
The following table describes the fields in the JSON object response:
Field Description
queueDuration Time the request was queued in milliseconds.
queryDuration Time the request ran once submitted in milliseconds.
results Array of the result sets, update counts produced by the submitted SQL. The array has more than one element if the submitted SQL contains more than one statement or if a stored procedure was called that returns more than one result set.
The following fields may be present inside of a result array element:
  • resultSet: Indicates if the result is a result set (true) or an update count (false).
  • columns: Contains an array of the columns comprising the result set. Each column contains a name and type field containing the column name and SQL type (only present if resultSet is true and includeColumns is true when the request is submitted).
  • outParams: An object of key-value pairs representing the output parameters from a stored procedure.
  • Data: Contains the data produced by the query. The format depends on the value of the format attribute specified with the request. For example, an array of arrays or an array of objects. The data field is only present when resultSet is true.
  • rowCount: Number of rows returned if the row limit is set, else the update count.
  • rowLimitExceeded: Indicates if the number of rows in the result exceeded the number of rows specified in rowLimit.
responseError The field is only present if an error occurs while the query is in the RESPONDING state. In this case, a successful status is already sent to the client, so responseError is included as the last field in the JSON response.