Submit SQL Statement | Teradata Query Service - Submitting SQL Statement - 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

To submit a SQL request to a Teradata Database using Query Service, send a POST request to the /system/[systemName]/queries endpoint, replacing [systemName] with the preconfigured alias of the system.

POST /systems/mysystem/queries HTTP/1.1 Authorization: Basic ZGJjOmRiYw==
Accept: application/vnd.com.teradata.rest-v1.0+json Content-Type: application/json

{
"query”:”SELECT * FROM DBC.DBCInfo”,
"format":”array", "includeColumns":true
}
The request includes:
  • The query, SELECT * FROM DBC.DBCInfo to the system with the alias "mysystem"
  • The username and password "dbc" (ZGJjOmRiYw== is "dbc:dbc" Base64 encoded)
  • The format for response ("format": "array")
  • The request to include column information ("includeColumns": true)

Responses to SQL requests are synchronous, meaning the HTTP response to the HTTP request contains the SQL request results.