Queries the details of an SQL task.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListDBTaskSQLJobDetail

The operation that you want to perform. Set the value to ListDBTaskSQLJobDetail.

JobId Long Yes 1276****

The ID of the SQL task. You can call the ListDBTaskSQLJob operation to query the SQL task ID.

PageNumber Long No 1

The number of the page to return.

PageSize Long No 20

The number of entries to return on each page.

Tid Long No 3***

The ID of the tenant. You can call the GetUserActiveTenant operation to query the tenant ID.

RegionId String No cn-hangzhou

The ID of the region in which Data Management (DMS) is activated. Set this parameter to the ID of the region that is in proximity to your applications. For more information about the valid values of this parameter, see RegionID parameter.

Response parameters

Parameter Type Example Description
RequestId String 3F044E33-FE09-58F1-8C61-A0F612EC****

The ID of the request.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
ErrorMessage String JobId is mandatory for this action.

The error message that is returned.

ErrorCode String MissingJobId

The error code that is returned.

DBTaskSQLJobDetailList Array of DBTaskSQLJobDetail

The details of SQL tasks.

JobDetailId Long 24723****

The ID of the details of the SQL task.

CurrentSql String update a set id = 1 where id = 1;

The SQL statement that was executed in the SQL task.

ExecuteCount Long 1

The number of times that the SQL statement was executed.

JobId Long 1276****

The ID of the SQL task.

DbId Long 1988****

The ID of the physical database.

Logic Boolean false

Indicates whether the database is a logical database. Valid values:

  • true: The database is a logical database.
  • false: The database is a physical database.
Skip Boolean false

Indicates whether the SQL statement was skipped. Valid values:

  • true: The SQL statement was skipped.
  • false: The SQL statement was not skipped.

The type of the SQL statement, such as DELETE, UPDATE, or ALTER_TABLE.

Status String SUCCESS

The status of the SQL task. Valid values:

  • INIT: The SQL task was initialized.
  • PENDING: The SQL task waited to be run.
  • BE_SCHEDULED: The SQL task waited to be scheduled.
  • FAIL: The SQL task failed.
  • SUCCESS: The SQL task was successful.
  • PAUSE: The SQL task was paused.
  • DELETE: The SQL task was deleted.
  • RUNNING: The SQL task was being run.
Log String log_info

The details of the operational log.

StartTime String 2021-12-16 00:00:00

The point in time when the SQL task started.

EndTime String 2021-12-16 00:00:01

The point in time when the SQL task ended.

TimeDelay Long 38

The duration of the SQL task. Unit: milliseconds.

AffectRows Long 0

The number of rows affected by the SQL task.

TotalCount Long 1

The total number of SQL tasks.


Sample requests

&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK

    <ErrorMessage>JobId is mandatory for this action.</ErrorMessage>
        <CurrentSql>update a set id = 1 where id  = 1;</CurrentSql>
        <StartTime>2021-12-16 00:00:00</StartTime>
        <EndTime>2021-12-16 00:00:01</EndTime>

JSON format

HTTP/1.1 200 OK

  "RequestId" : "3F044E33-FE09-58F1-8C61-A0F612EC****",
  "Success" : true,
  "ErrorMessage" : "JobId is mandatory for this action.",
  "ErrorCode" : "MissingJobId",
  "DBTaskSQLJobDetailList" : [ {
    "CurrentSql" : "update a set id = 1 where id  = 1;",
    "ExecuteCount" : 1,
    "Logic" : false,
    "Skip" : false,
    "SqlType" : "CREATE_TABLE",
    "Status" : "SUCCESS",
    "Log" : "log_info",
    "StartTime" : "2021-12-16 00:00:00",
    "EndTime" : "2021-12-16 00:00:01",
    "TimeDelay" : 38,
    "AffectRows" : 0
  } ],
  "TotalCount" : 1

Error codes

For a list of error codes, visit the API Error Center.