Queries the precheck information about an SQL statement that is specified in a data change ticket.

For more information about the Normal Data Modify feature, see Change regular data.

Debugging

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 ListDataCorrectPreCheckSQL

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

OrderId Long Yes 12****

The ID of the ticket for the data change.

PageNumber Long No 1

The number of the page to return.

Valid values: an integer that is greater than 0.

Default value: 1.

PageSize Long No 10

The number of entries to return on each page.

DbId Long No 11****

The ID of the database.

Tid Long No 1

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

RegionId String No cn-hangzhou

The ID of the region where DMS is activated. For more information about the valid values of the parameter, see RegionID parameter.

Note Set this parameter to the ID of the region that is close to your service.

Response parameters

Parameter Type Example Description
RequestId String 4B2520C9-3005-4CCA-9C9B-944254ABEB0B

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

ErrorMessage String UnknownError

The error message returned.

ErrorCode String UnknownError

The error code returned.

PreCheckSQLList Array of PreCheckSQL

The precheck information about SQL statements.

CheckSQL String CREATE TABLE t1 ...

The SQL statement.

AffectRows Long 0

The estimated number of affected rows.

DbId Long 431253

The ID of the database.

SQLReviewQueryKey String b9e771fc6ec247dea6d06a32c777****

The key that is used to query the details of optimization suggestions. You can call the GetSQLReviewOptimizeDetail operation to query the details of optimization suggestions based on the key.

SqlReviewStatus String PASS

The review status of the SQL statement. Valid values:

  • WAITING: The SQL statement is pending for review.
  • RUNNING: The SQL statement is being reviewed.
  • IGNORE: The SQL statement review is skipped.
  • PASS: The SQL statement passed the review.
  • BLOCK: The SQL statement failed the review.
SqlType String CREATE_TABLE

The type of the SQL statement.

Examples

Sample requests

http(s)://dms-enterprise.aliyuncs.com/?Action=ListDataCorrectPreCheckSQL
&OrderId=12345
&PageNumber=1
&PageSize=10
&DbId=111222
&Tid=1
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListDataCorrectPreCheckSQLResponse>
    <RequestId>B02A7F37-96D2-4712-9196-4A5C94174A75</RequestId>
    <PreCheckSQLList>
        <CheckSQL>CREATE TABLE IF NOT EXISTS `task_data_2020-10` LIKE task_data</CheckSQL>
        <SqlReviewStatus>PASS</SqlReviewStatus>
        <DbId>8050000</DbId>
        <SqlType>CREATE_TABLE</SqlType>
        <AffectRows>0</AffectRows>
        <SQLReviewQueryKey>4eb7635609c54ced8c584e926aa7****</SQLReviewQueryKey>
    </PreCheckSQLList>
    <Success>true</Success>
</ListDataCorrectPreCheckSQLResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "B02A7F37-96D2-4712-9196-4A5C94174A75",
  "PreCheckSQLList" : [ {
    "CheckSQL" : "CREATE TABLE IF NOT EXISTS `task_data_2020-10` LIKE task_data",
    "SqlReviewStatus" : "PASS",
    "DbId" : 8050000,
    "SqlType" : "CREATE_TABLE",
    "AffectRows" : 0,
    "SQLReviewQueryKey" : "4eb7635609c54ced8c584e926aa7****"
  } ],
  "Success" : true
}

Error codes

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