メインコンテンツへスキップ
POST
/
query
Execute Query
curl --request POST \
  --url https://cloud.cdata.com/api/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "defaultCatalog": "<string>",
  "defaultSchema": "<string>",
  "parameters": {},
  "schemaOnly": true,
  "timeout": 150
}
'
{
  "results": [
    {
      "affectedRows": 123,
      "schema": [
        {
          "catalogName": "<string>",
          "columnLabel": "<string>",
          "columnName": "<string>",
          "dataType": 1,
          "dataTypeName": "<string>",
          "length": 123,
          "nullable": true,
          "ordinal": 123,
          "precision": 123,
          "scale": 123,
          "schemaName": "<string>",
          "tableName": "<string>"
        }
      ],
      "rows": [
        [
          "<unknown>"
        ]
      ]
    }
  ],
  "error": {
    "code": 0,
    "message": "<string>"
  }
}

承認

Authorization
string
header
必須

JWT token authentication. Include the token in the Authorization header as 'Bearer '.

ボディ

application/json
query
string
必須

The SQL query to execute. Must be a valid SQL query.

Minimum string length: 1
defaultCatalog
string | null

The default catalog to use for the query if none is specified in the query itself.

defaultSchema
string | null

The default schema to use for the query if none is specified in the query itself.

parameters
object
schemaOnly
boolean

If true, only the schema of the result set is returned without any data rows. The default value is false.

timeout
integer<int32>
必須範囲: 1 <= x <= 300

レスポンス

200 - application/json

OK

results
object[] | null
error
object