All Products
Search
Document Center

Data Management:ListSQLReviewOriginSQL

Last Updated:Mar 28, 2024

Queries the details of the SQL statements that are involved in an SQL review ticket.

Operation description

For more information about the SQL review feature, see SQL review.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListSQLReviewOriginSQLRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
OrderIdlongYes

The ID of the ticket for the SQL review. You can call the CreateSQLReviewOrder operation to query the ID of the ticket.

123321
OrderActionDetailobjectNo

The parameters that are used to filter SQL statements involved in the ticket.

FileIdlongNo

The ID of the file.

123345
SQLReviewResultstringNo

The optimization suggestion for the SQL statement. Valid values:

  • MUST_IMPROVE: The SQL statement must be improved.
  • POTENTIAL_ISSUE: The SQL statement contains potential issues.
  • SUGGEST_IMPROVE: We recommend that you improve the SQL statement.
  • USE_DMS_TOOLKIT: We recommend that you change schemas without locking tables.
  • USE_DMS_DML_UNLOCK: We recommend that you change data without locking tables.
  • TABLE_INDEX_SUGGEST: We recommend that you use SQL statements that use indexes.
MUST_IMPROVE
CheckStatusResultstringNo

The review status of the SQL statement. Valid values:

  • new: The SQL statement is pending for analysis.
  • unknown: The SQL statement failed to be parsed.
  • check_not_pass: The SQL statement failed the review.
  • check_pass: The SQL statement passed the review.
  • force_pass: The SQL statement passed the review by manual effort.
  • force_not_pass: The SQL statement failed the review by manual effort.
check_not_pass
PageobjectNo

The paging settings.

PageNumberintegerNo

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page.

20
TidlongNo

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

1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931
ErrorCodestring

The error code returned.

UnknownError
ErrorMessagestring

The error message returned.

UnknownError
Successboolean

Indicates whether the request is successful.

true
TotalCountinteger

The total number of the SQL statements.

10
OriginSQLListobject []

The information about the parsed SQL statements.

SQLIdlong

The ID of the SQL statement.

1111
FileIdlong

The ID of the file.

123321
FileNamestring

The name of the file.

test.sql
SQLContentstring

The SQL statement.

select id from table_name
CheckStatusstring

The review status of the SQL statement. Valid values:

  • new: The SQL statement is pending for analysis.
  • unknown: The SQL statement failed to be parsed.
  • check_not_pass: The SQL statement failed the review.
  • check_pass: The SQL statement passed the review.
  • force_pass: The SQL statement passed the review by manual effort.
  • force_not_pass: The SQL statement failed the review by manual effort.
check_pass
StatusDescstring

The description of the review status.

passed the test
CheckedTimestring

The time when the SQL statement is reviewed.

2021-06-09 21:07:00
SqlHashstring

The MD5 hash value of the SQL statement.

95adb6e77a0884d9e50232cb8c5c969d
ReviewSummarystring

The statistics of optimization suggestions for SQL statements. The value is a JSON string. The following optimization suggestions are involved:

  • MUST_IMPROVE: The SQL statement must be improved.
  • POTENTIAL_ISSUE: The SQL statement contains potential issues.
  • SUGGEST_IMPROVE: We recommend that you improve the SQL statement.
  • USEDMSTOOLKIT: We recommend that you change schemas without locking tables.
  • USEDMSDML_UNLOCK: We recommend that you change data without locking tables.
  • TABLEINDEXSUGGEST: We recommend that you use SQL statements that use indexes.
{"POTENTIAL_ISSUE":1,"SUGGEST_IMPROVE":1}
SQLReviewQueryKeystring

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.

a57e54ec5433475ea3082d882fdb89c5
SQLNamestring

SQLName.

getByPk

Examples

Sample success responses

JSONformat

{
  "RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true,
  "TotalCount": 10,
  "OriginSQLList": [
    {
      "SQLId": 1111,
      "FileId": 123321,
      "FileName": "test.sql",
      "SQLContent": "select id from table_name",
      "CheckStatus": "check_pass",
      "StatusDesc": "passed the test",
      "CheckedTime": "2021-06-09 21:07:00",
      "SqlHash": "95adb6e77a0884d9e50232cb8c5c969d",
      "ReviewSummary": "{\"POTENTIAL_ISSUE\":1,\"SUGGEST_IMPROVE\":1}",
      "SQLReviewQueryKey": "a57e54ec5433475ea3082d882fdb89c5",
      "SQLName": "getByPk"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history