Skip to main content
Join our research panel and help shape the future of Teradata.Sign up.

Teradata Query Service (@projectVersion@)

Download OpenAPI specification:Download

The Query Service is a RESTful web service for Teradata-supported databases that allows web pages, mobile devices, and scripting languages to query a Teradata-supported database using HTTP as the wire protocol and JSON as the data interchange format. Since support for HTTP and JSON is available in most programming languages, applications can use this service to access a Teradata-supported database without requiring a driver.

This service offers a large number of API's, but most applications will only need to use the POST /system/[systemName]/queries API. This API enables you to submit a query and get back the response in a single API call. Several examples of this API are presented below, but first let's cover some information common to all Query Service REST API endpoints.

HTTP Headers

There are several HTTP headers that must be submitted along with each request and some that are optional.

Header Value Description Required
Authorization Bearer TOKEN Contains an access token issued by the Query Service One of these two is required
Authorization Basic [Base64 encoded "username:password"] Contains the credentials used to access the Teradata Database. The Authorization header is constructed as follows: 1. Username and password are combined into a string "username:password" 2. The resulting string is then encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line 3. The authorization method and a space i.e. "Basic " is then put before the encoded string. One of these two is required
Accept application/vnd.com.teradata.rest-v1.0+json Instructs the web service that the client wants to use the 1.0 version of the REST API for Teradata Database. Ensures backwards compatibility if the REST API ever changes. Yes
Accept-Encoding gzip Instructs the web service to GZIP compress the response. If omitted, the response will be returned without compression. No
Content-Type application/json Instructs the web service that the request contains JSON data. Yes

Status Codes

Each HTTP Response will contain a status code as listed in the table below.

Code Definition Description
200 OK The request was successful.
201 Created The request was successful and the response contains the created object info
400 Bad Request The request could not be understood by the service due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
401 Unauthorized The request requires user authentication.
404 Not Found The resource referenced by the specified URI was not found.
412 Precondition Failed The specified session is currently in use or there are no available threads to execute the request and the queue timeout is exceeded.
420 Database Error The target Teradata Database returned an error.
429 Too Many Sessions The user has already reached the session limit.
500 Internal Server Error The service encountered an unexpected condition which prevented it from fulfilling the request.

When the status code is not 200 OK or 201 Created the response body will contain a JSON response containing an error message and possibly an error code returned by the target database.

{
  "error":"3802",
  "message":"Database 'MyDatabase' does not exist.",
}

Submitting SQL statements

To submit an SQL request to a Teradata Database using this web service, you send a POST request to the /system/[systemName]/queries API endpoint, replacing [systemName] with the nickname of a system that has been defined by an administrator using the System Service.

Result Set Formats

The format of the response to an SQL request depends on the requested format. Three formats are supported: object, array, and csv. Both object and array options generate JSON responses, while the csv option generates a comma separated value response.

JSON Object

JSON Object is the default result format. This format creates a JSON object per row with the column names as the field names and the column values as the field values.

curl --insecure -X POST \
"$HOST:1443/api/query/systems/prod/queries" \
-H 'Accept: application/vnd.com.teradata.rest-v1.0+json, */*; q=0.01' \
-H 'Content-Type: application/json' \
-H "Authorization: Basic ZGJjOmRiYw==' \
-d '{"query": "SELECT * FROM dbc.dbcinfo"}'

In the example above, we are submitting a SELECT * FROM DBC.DBCInfo query to the system nicknamed "prod" and using TD2 authentication with the username and password "dbc" ("ZGJjOmRiYw==" is "dbc:dbc" Base64 encoded). The results will be returned in the default JSON Object format:

{
  "queryDuration": 45,
  "queueDuration": 3,
  "results": [
  {
    "data": [
    {
      "InfoData": "16.20.00.00",
      "InfoKey": "VERSION"
    },
    {
      "InfoData": "Japanese",
      "InfoKey": "LANGUAGE SUPPORT MODE"
    },
    {
      "InfoData": "16.20.00.00",
      "InfoKey": "RELEASE"
    }
    ],
    "resultSet": true,
    "rowCount": 3,
    "rowLimitExceeded": false
  }
  ]
}

The JSON object response contains the following fields:

  • queueDuration How long the request was queued in milliseconds.

  • queryDuration How long the request ran once submitted in milliseconds.

  • results An array of the result sets, update counts produced by the submitted SQL. The array will have 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's name and SQL type respectively (only present if resultSet is true and include_columns was true when the request was 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 (e.g. an array of arrays, or an array of objects). The data field is only present when resultSet is true.
    • rowCount - If a result set, the number of rows returned up to the row limit if set, else the update count.
    • rowLimitExceeded - Flags if the number of rows in the result exceeded the number of rows specified in the rowLimit.
  • responseError This field will typically not be present. It is only present if an error occurs while the query is in the RESPONDING state. In this case, a successful status would have already been sent to the client, which is why any responseErrors are included as the last field in the JSON response.

JSON Array

The JSON Array format is similar to JSON object format except instead of a JSON object per row, there is a JSON array per row where each column value is an element in the array.

curl --insecure -X POST \
"$HOST:1443/api/query/systems/prod/queries" \
-H 'Accept: application/vnd.com.teradata.rest-v1.0+json, */*; q=0.01' \
-H 'Content-Type: application/json' \
-H "Authorization: Basic ZGJjOmRiYw==' \
-d '{"query": "SELECT * FROM dbc.dbcinfo", "format": "array", "include_columns": true }'

The request above demonstrates several availble options:

  • The response will be in JSON array format ("format": "array") .
  • The response will include column information ("include_columns": true).

Here are sample results:

{
  "queryDuration": 11,
  "queueDuration": 3,
  "results": [
  {
    "columns": [
    {
      "name": "InfoKey",
      "type": "VARCHAR"
    },
    {
      "name": "InfoData",
      "type": "VARCHAR"
    }
    ],
    "data": [
      [
      "VERSION",
      "16.20.00.00"
      ],
      [
        "LANGUAGE SUPPORT MODE",
        "Japanese"
        ],
      [
        "RELEASE",
        "16.20.00.00"
        ]
      ],
    "resultSet": true,
    "rowCount": 3,
    "rowLimitExceeded": false
  }
  ]
}

Comma Separated Value (CSV)

CSV format does not contain any meta data about the response and simply contains the query results. The response contains a line for each row where each line contains the row's column values separated by a comma.

curl --insecure -X POST \
"$HOST:1443/systems/prod/queries" \
-H 'Accept: application/vnd.com.teradata.rest-v1.0+json, */*; q=0.01' \
-H 'Content-Type: application/json' \
-H "Authorization: Basic ZGJjOmRiYw==' \
-d '{"query": "SELECT * FROM dbc.dbcinfo", "format": "csv", "include_columns": true}'

The output for CSV format will look like this:

InfoKey,InfoData
VERSION,16.20.00.00
LANGUAGE SUPPORT MODE,Japanese
RELEASE,16.20.00.00

The first row contains the column names (because we requested include_columns).

Managing Database Sessions

There are two ways that database sessions are created by the Query Service. The first way is when a client submits a query without referencing a session ID. If an idle session does not already exist for the specified credentials, a new session is created based on the default settings configured for the target system. This type of session is called an implicit session. The second way a session is created is if a client calls POST /system/[systemName]/sessions to open a session. This type of session is called an explicit session.

Each session remains open until the session is idle for the configured maxIdleTime or until closed by calling DELETE /system/[systemName]/sessions/[sessionId]. Implicit sessions are reused if they are idle and if the credentials specified by the client are the same as when the session was created. If there are no sessions that match that criteria, then a new implicit session can be created, up to the maximum number of implicit sessions allowed per user. If the maximum number of implicit sessions are reached and none are idle, then the request will be queued.

Explicit sessions are only used if a client references them in a query request. If a request references an explicit session that is already in use, the request will be queued. Explicit sessions should be used when a transaction needs to span multiple requests or when using volatile tables

General

API's for fetching GeneralConfig of Teradata database configuration.

Get General service Configuration

Get General service Configuration.

Authorizations:
None
header Parameters
Authorization
required
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Updates General service Configuration

Updates General service Configuration.

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service adminuser account.

Request Body schema: application/json
required

The details of the system to create or update.

maxThreadCount
number (maxThreadCount)

maxThreadCount of a general service configuration.

noRowsSpoolQuery
number (noRowsSpoolQuery)

noRowsSpoolQuery of a general service configuration.

noSpoolResultSets
number (maxThreadCount)

noSpoolResultSets of a general service configuration.

retentionSpool
number (retentionSpool)

retentionSpool of a general service configuration.

spaceAvailable
number (spaceAvailable)

spaceAvailable of a general service configuration.

spoolDirectory
string (spoolDirectory)

spoolDirectory.

Responses

Request samples

Content type
application/json
{
  • "maxThreadCount": 0,
  • "noRowsSpoolQuery": 0,
  • "noSpoolResultSets": 0,
  • "retentionSpool": 0,
  • "spaceAvailable": 0,
  • "spoolDirectory": "string"
}

Update Teradata database configuraton.

Update Teradata database configuraton.

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service adminuser account.

Request Body schema: application/json
required

The details of the system to create or update.

maxThreadCount
number (maxThreadCount)

maxThreadCount of a general service configuration.

noRowsSpoolQuery
number (noRowsSpoolQuery)

noRowsSpoolQuery of a general service configuration.

noSpoolResultSets
number (maxThreadCount)

noSpoolResultSets of a general service configuration.

retentionSpool
number (retentionSpool)

retentionSpool of a general service configuration.

spaceAvailable
number (spaceAvailable)

spaceAvailable of a general service configuration.

spoolDirectory
string (spoolDirectory)

spoolDirectory.

Responses

Request samples

Content type
application/json
{
  • "maxThreadCount": 0,
  • "noRowsSpoolQuery": 0,
  • "noSpoolResultSets": 0,
  • "retentionSpool": 0,
  • "spaceAvailable": 0,
  • "spoolDirectory": "string"
}

Admin

API's for admin users.

Get a list of all admin users.

Get a list of all admin users.

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Updates password for an admin user

Updates password for an admin user

Authorizations:
None
path Parameters
userId
required
string

The userId of the admin user

header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service adminuser account.

Request Body schema: application/json
required

The details of the system to create or update.

oldPassword
string (oldPassword)

oldPassword of a Admin User.

newPassword
string (newPassword)

newPassword of a Admin User.

confirmPassword
string (confirmPassword)

confirmPassword of a Admin User.

Responses

Request samples

Content type
application/json
{
  • "oldPassword": "string",
  • "newPassword": "string",
  • "confirmPassword": "string"
}

Certificates

API's to install/update/delete certiicates.

Get a certificate

Get the certificate with the specified name.

Authorizations:
None

Responses

Install a HTTPS certificate.

Install a HTTPS certificate.The customer needs to generate the certificate from the already created CSR from this query-service instance.

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Request Body schema: multipart/form-data
required
certificate
required
string <binary>

The file to upload.

Responses

Delete a certificate.

Delete the certificates with the specified name.

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Get certificate authorities

Get the certificate authorities.

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Install a trusted signed certificate.

Install a trusted signed certificate.The customer needs to generate the certificate from the already created CSR from this query-service instance.

Authorizations:
None
query Parameters
certificateAlias
required
string
Example: certificateAlias=teradata
alias
required
string
Example: alias=teradata
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Request Body schema: multipart/form-data
required
certificate
required
string <binary>

The file to upload.

Responses

Get a certificate config

Get the certificate config with the specified name.

Authorizations:
None
path Parameters
certificate
required
string

The name of the certificate to retrieve.

Responses

Create or update certificate config

Create or update certificate config

Authorizations:
None
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Request Body schema: application/json
required

The details of the system to create or update.

maxThreadCount
number (maxThreadCount)

maxThreadCount of a general service configuration.

noRowsSpoolQuery
number (noRowsSpoolQuery)

noRowsSpoolQuery of a general service configuration.

noSpoolResultSets
number (maxThreadCount)

noSpoolResultSets of a general service configuration.

retentionSpool
number (retentionSpool)

retentionSpool of a general service configuration.

spaceAvailable
number (spaceAvailable)

spaceAvailable of a general service configuration.

spoolDirectory
string (spoolDirectory)

spoolDirectory.

Responses

Request samples

Content type
application/json
{
  • "maxThreadCount": 0,
  • "noRowsSpoolQuery": 0,
  • "noSpoolResultSets": 0,
  • "retentionSpool": 0,
  • "spaceAvailable": 0,
  • "spoolDirectory": "string"
}

Create or update a self signed certificate.

Create or update a self signed certificate.

Authorizations:
None
query Parameters
commonName
required
string
Example: commonName=sdl67589

Common Name

organizationalUnit
required
string
Example: organizationalUnit=UDA

Organizational Unit

organization
required
string
Example: organization=Teradata Corporation

Organization

city
required
string
Example: city=San Diego

City or locality

state
required
string
Example: state=California

State or Povince

country
required
string
Example: country=US

Country

email
string
Example: email=john.doe@teradata.com

Email

expiration
string
Example: expiration=12

Expiration in months

san1
string
Example: san1=sdl67589
san2
string
Example: san2=sdl67589
san3
string
Example: san3=sdl67589
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Create CSR

Create CSR.

Authorizations:
None
query Parameters
commonName
required
string
organizationalUnit
required
string
organization
required
string
country
required
string
city
required
string
state
required
string
header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Create or update a PKCS certificate.

Create or update a PKCS certificate.

Authorizations:
None
query Parameters
password
required
string

Password for the pkcs file

header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Request Body schema: multipart/form-data
required
certificate
required
string <binary>

The PKCS file to upload.

Responses

Database

API's for fetching metadata about databases, tables, macros, etc.

Get a list of the databases on a specific target system.

Get a list of the databases on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which all databases should be retrieved

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get a database on a specific target system.

Get a database on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which all databases should be retrieved.

databaseName
required
string

The name of the database to retrieve.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get all functions of a database on a specific target system.

Get all functions of a database on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the database resides

databaseName
required
string

The name of the database on the specified system for which all functions should be retrieved

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get all macros of a database on a specific target system.

Get all macros of a database on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the database resides

databaseName
required
string

The name of the database on the specified system for which all macros should be retrieved

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get all procedures of a database on a specific target system.

Get all procedures of a database on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the database resides

databaseName
required
string

The name of the database on the specified system for which all procedures should be retrieved

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get all tables of a single database.

Get all tables of a single database on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the database resides

databaseName
required
string

The name of the database on the specified system for which all tables should be retrieved

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get a specific table of a database.

Get a specific table of a database on the specified target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the table resides

databaseName
required
string

The name of the database on the specified system for which the specified table should be retrieved

tableName
required
string

The name of the table to retrieve.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get All Views of a database.

Get all views of a database on the specified target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the database resides

databaseName
required
string

The name of the database on the specified system for which all views should be retrieved

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get a specific view of a database.

Get a specific view of a database on the specified target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the view resides

databaseName
required
string

Name of the database to retrieve the view.

viewName
required
string

The name of the view to retrieve.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Query

API's for submitting and managing queries.

Get all the queries for a specified system.

Get all the queries for a specified system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which all queries should be retrieved.

query Parameters
session
number

The session number for which all queries should be retrieved.

state
string
Enum: "QUEUED" "PENDING" "SUBMITTED" "RESPONDING" "SPOOLING" "RESULT_SET_READY"

A QueryState value that will be used to filter the results.

clientId
string

A client ID that will be used to filter the results.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Submit a Query to the target system.

Submit a Query to the target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system to which the query should be submitted.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Request Body schema: application/json
required

The details of the query to submit to the database.

batch
boolean (batch)

True if the statements are run using JDBC batch processing. Default: false.

client_id
string (client_id)

An id specified by the client when the query was submitted.

continue_on_error
boolean (continue_on_error)

If true, then during batch processing, continue executing queries after a failure. Default: false

date_format
string (date_format)
Enum: "EPOCH_MILLIS" "TD_DB" "ISO_8601"

The format in which to render dates

format
string (format)
Enum: "OBJECT" "ARRAY" "CSV"

The format of the result set. "object" means data is returned as an array of JSON objects. "array" means the data is returned as an array of JSON arrays. "csv" means the data is returned as comma separated values.

include_column_types
boolean (include_column_types)

If true, include the type of each column in the results. Default false.

include_columns
boolean (include_columns)

If true, include the name of each column in the results. Default false.

log_mech
string (log_mech)
Enum: "DEFAULT" "TD1" "TD2" "KRB5" "LDAP" "JWT"

The logon mechanism to use for the session.

out_params
Array of strings (out_params)

An array of names of output parameters for a stored procedure.

params
Array of any (params) [ items ]

An array of arrays containing parameters to the SQL statement. If more than one array exists, the statement is run multiple times, each time with the next array of parameters in the array.

query
string (query)

The SQL query text to execute.

query_bands
object (query_bands)

The query bands to set for the request

query_timeout
number (query_timeout)

The maximum number of seconds the request will be allowed to execute. Default: unlimited

queue_timeout
number (queue_timeout)

The maximum number of seconds the request will be queued waiting to execute. Default: unlimited

row_limit
number (row_limit)

The maximum number of rows of data to include in the response. Set to zero for no limit. Default: 1000

row_offset
number (row_offset)

The number of rows to discard at the beginning of the result set. Typically used when implementing paging.

session
number (session)

The Query Service internal explicit session number to use for this query.

trim_white_space
boolean (trim_white_space)

If true, trim white space from fixed length columns. Default: true.

Responses

Request samples

Content type
application/json
{
  • "batch": true,
  • "client_id": "string",
  • "continue_on_error": true,
  • "date_format": "EPOCH_MILLIS",
  • "format": "OBJECT",
  • "include_column_types": true,
  • "include_columns": true,
  • "log_mech": "DEFAULT",
  • "out_params": [
    ],
  • "params": [
    ],
  • "query": "string",
  • "query_bands": {
    },
  • "query_timeout": 0,
  • "queue_timeout": 0,
  • "row_limit": 0,
  • "row_offset": 0,
  • "session": 0,
  • "trim_white_space": true
}

Delete a query by ID.

Delete the query with the specified ID.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which the query with the specified ID should be deleted.

id
required
number

The ID of the query to delete.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get a specific query by ID.

Get a specific query by ID.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which the query with the specified ID should be retrieved.

id
required
number

The ID of the query to retrieve.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get specific query results by ID.

Get specific query results by ID.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which the results of the specified query should be retrieved.

id
required
number

The ID of the query for which to retrieve results.

query Parameters
rowOffset
number

The number of rows by which the returned results should be offset.

rowLimit
number

The maximum number of rows that should be present in the returned results.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Session

API's for managing explict sessions. Explicit sessions are an optional feature that give you complete control over the creation, usage, and removal of database sessions. You would want to use excplicit sessions if you are using session specific features such as temporary tables or transactions that span multiple statements.

Get the list of sessions open to a specific target system.

Get the list of sessions open to a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which all sessions should be retrieved

query Parameters
createMode
string
Enum: "IMPLICIT" "EXPLICIT"

A CreateMode value that will be used to filter the results.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Create an explicit session on a specific target system.

Create an explicit session on a specific target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system on which the session should be created.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Request Body schema: application/json
required

The details of the session to create.

auto_commit
boolean (account)

True to put the session in autoCommit mode else false to handle transactions explicitly.

account
string (account)

The account string to associate with the session.

catalog
string (catalog)

The default catalog for the session. Does not apply to Teradata SQL Engine.

char_set
string (char_set)
Enum: "ASCII" "UTF8" "UTF16" "EBCDIC273_0E" "HANGULEBCDIC933_1II" "KANJIEBCDIC5026_0I" "KANJIEUC_0U" "KATAKANAEBCDIC" "LATIN1252_0A" "EBCDIC037_0E" "EBCDIC277_0E" "HANGULKSC5601_2R4" "KANJIEBCDIC5035_0I" "KANJISJIS_0S" "LATIN1_0A" "LATIN9_0A"

The character set to use for the session.

default_database
string (default_database)

The default database for the session.

fetch_count
number (fetch_count)

The fetch count (Aster specific).

log_mech
string (log_mech)
Enum: "DEFAULT" "TD1" "TD2" "KRB5" "LDAP" "JWT"

The logon mechanism (such as TD2, LDAP, etc.) to use for the session.

query_bands
object (query_bands)

The query bands to set on the session when its created.

schema
string (schema)

The default schema to use for the session. Does not apply to Teradata SQL Engine.

transaction_mode
string (transaction_mode)
Enum: "DEFAULT" "ANSI" "TERA"

The transaction mode to use for the session.

Responses

Request samples

Content type
application/json
{
  • "auto_commit": true,
  • "account": "string",
  • "catalog": "string",
  • "char_set": "ASCII",
  • "default_database": "string",
  • "fetch_count": 0,
  • "log_mech": "DEFAULT",
  • "query_bands": {
    },
  • "schema": "string",
  • "transaction_mode": "DEFAULT"
}

Close the session with a specific ID.

Close the session with the specified ID. Only explicit sessions can be closed. An explicit session that is idle for longer than the configured idle_timeout will be closed automatically.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which the session with the specified ID should be closed.

id
required
number

The ID of the session to close.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

Get the session by ID.

Get the session with the specified ID.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system for which the session with the specified ID should be retrieved.

id
required
number

The ID of the session to retrieve.

header Parameters
Authorization
required
string <BasicAuth>

Basic Authorization. This should be database credentials. An access token can also be used with this API.

Responses

System

Get a list of the configured target systems.

Get a list of the configured target systems.

Authorizations:
None

Responses

Delete the target system with the specified name.

Delete the system with the specified name.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system to delete.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Responses

Get the target system with a specific name

Get the target system with a specific name.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system to retrieve.

Responses

Create or update the target system.

Create or update the target system.

Authorizations:
None
path Parameters
systemName
required
string

The name of the system to create or update.

header Parameters
Authorization
string <BasicAuth>

Basic Authorization of query service admin account.

Request Body schema: application/json
required

The details of the system to create or update.

default_char_set
string (default_char_set)
Enum: "ASCII" "UTF8" "UTF16" "EBCDIC273_0E" "HANGULEBCDIC933_1II" "KANJIEBCDIC5026_0I" "KANJIEUC_0U" "KATAKANAEBCDIC" "LATIN1252_0A" "EBCDIC037_0E" "EBCDIC277_0E" "HANGULKSC5601_2R4" "KANJIEBCDIC5035_0I" "KANJISJIS_0S" "LATIN1_0A" "LATIN9_0A"
default_database
string (default_database)
default_transaction_mode
string (default_transaction_mode)
Enum: "DEFAULT" "ANSI" "TERA"
include_or_exclude_user_list
Array of strings (include_or_exclude_user_list)
log_mech
string (log_mech)
Enum: "DEFAULT" "TD1" "TD2" "KRB5" "LDAP" "JWT"
query_bands
object (query_bands)
system_id
string (system_id)
system_type
string (system_type)
Enum: "TERADATA" "ASTER" "PRESTO"

Responses

Request samples

Content type
application/json
{
  • "default_char_set": "ASCII",
  • "default_database": "string",
  • "default_transaction_mode": "DEFAULT",
  • "include_or_exclude_user_list": [
    ],
  • "log_mech": "DEFAULT",
  • "query_bands": {
    },
  • "system_id": "string",
  • "system_type": "TERADATA"
}