View execution result¶
Reads the result rows of a SQL query that completed successfully. When you need to download the complete results, please use Download SQL execution results.
POST $CLOUDSIGMA_API_BASE/query/result
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.
Prepare personal access token and target workspace ID that can access the target workspace.
Query the SQL execution status, confirm that the query is successful, and record the result ID (
statement_id) in the response.
Only the results of queries created and successfully completed by the current identity can be read.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID and $STATEMENT_ID with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/query/result" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"statement_id\": \"$STATEMENT_ID\", \"offset\": 0, \"limit\": 20}"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The result ID of a successful execution of the view. |
|
integer |
No |
The line position to start reading, starting from 0. |
|
integer |
No |
The maximum number of rows returned this time. When 0 is not provided or is less than or equal to 0, the server uses 1000. |
Successful response¶
{
"code": 200,
"data": {
"query_id": "query_01",
"db_name": "",
"statement_id": "00000000-0000-4000-8000-000000000001",
"status": "success",
"offset": 0,
"limit": 20,
"total": 1,
"columns": [
{
"name": "n",
"type": "INT64"
}
],
"result": [
[
{
"String": "1",
"Valid": true
}
]
]
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
response data. |
|
string |
The ID of the query that produced the result. Can be omitted if not set. |
|
string |
Currently fixed to an empty string. The database name at execution time is read from the execution status interface. |
|
string |
Statement ID of this result. |
|
string |
success when the result is read successfully. |
|
string |
Execute error description. May be omitted if not set. |
|
integer |
The line position where reading starts this time. |
|
integer |
The maximum number of rows returned for this request. |
|
integer |
The number of rows returned this time. |
|
array of object |
Returns column definitions in the same order as the cells in each row of results. Can be omitted if not set. |
|
string |
Name. |
|
string |
Operation type. |
|
array of array of object |
A two-dimensional array of query results. Can be omitted if not set. |
|
object |
Empty result description. Can be omitted if not set. |
|
string |
Description text. |
Error response¶
{
"code": 404,
"message": "SQL 查询结果不存在"
}
Field |
Type |
Description |
|---|---|---|
|
integer or string |
SQL processing errors may be numeric status codes. Authentication or general service errors may be string error codes. |
|
string |
error message. |
Errors are encapsulated in two ways: The SQL processing path uses {“code”:400,”message”:”…”}. Authentication or general service error using {“code”:”ErrServer”,”msg”:”…”}. Both message and msg are readable error messages, which should be read based on the actual fields and cannot be judged only by the numerical code.