All Products
Search
Document Center

Data Management:ListSQLReviewOriginSQL

Last Updated:Oct 21, 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
OrderIdlongYes

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

123321
OrderActionDetailobjectNo

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

FileIdlongNo

The ID of the file that contains the SQL statements to be reviewed.

123345
SQLReviewResultstringNo

The optimization suggestion for the SQL statement. Valid values:

  • MUST_IMPROVE: The SQL statement must be optimized.
  • POTENTIAL_ISSUE: The SQL statement contains potential issues.
  • SUGGEST_IMPROVE: We recommend that you optimize 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 optimize indexes for the SQL statement.
MUST_IMPROVE
CheckStatusResultstringNo

The review status of the SQL statement. Valid values:

  • new: The SQL statement was waiting to be reviewed.
  • unknown: The SQL statement cannot be parsed.
  • check_not_pass: The SQL statement failed to pass the review.
  • check_pass: The SQL statement passed the review.
  • force_pass: The SQL statement passed the manual review.
  • force_not_pass: The SQL statement failed to pass the manual review.
check_not_pass
PageobjectNo

The pagination information.

PageNumberintegerNo

The page number.

1
PageSizeintegerNo

The number of entries per page.

20
TidlongNo

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

1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

The error code that is returned.

UnknownError
ErrorMessagestring

The error message that is returned if the request failed.

UnknownError
Successboolean

Indicates whether the request was successful. Valid values: Valid values:

  • true
  • false
true
TotalCountinteger

The number of SQL statements in the file.

10
OriginSQLListarray<object>

The information about the parsed SQL statements.

OriginSQLListobject
SQLIdlong

The ID of the SQL statement.

1111
FileIdlong

The file ID.

123321
FileNamestring

The name of the file.

test.sql
SQLContentstring

The SQL statement in the file.

select id from table_name
CheckStatusstring

The review status of the SQL statement. Valid values:

  • new: The SQL statement was waiting to be reviewed.
  • unknown: The SQL statement cannot be parsed.
  • check_not_pass: The SQL statement failed to pass the review.
  • check_pass: The SQL statement passed the review.
  • force_pass: The SQL statement passed the manual review.
  • force_not_pass: The SQL statement failed to pass the manual review.
check_pass
StatusDescstring

The description of the review status.

passed the test
CheckedTimestring

The time when the SQL statement was reviewed.

2021-06-09 21:07:00
SqlHashstring

The MD5 hash value that is obtained after the SQL statement is calculated by using a hash algorithm.

95adb6e77a0884d9e50232cb8c5c969d
ReviewSummarystring

The statistics on the optimization suggestions for SQL statements. The value is a JSON string. Valid values:

  • MUST_IMPROVE: The SQL statements must be optimized.
  • POTENTIAL_ISSUE: The SQL statements contain potential issues.
  • SUGGEST_IMPROVE: We recommend that you optimize the SQL statements.
  • 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 optimize indexes for the SQL statements.
{"POTENTIAL_ISSUE":1,"SUGGEST_IMPROVE":1}
SQLReviewQueryKeystring

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

a57e54ec5433475ea3082d882fdb89c5
SQLNamestring

The name of the SQL statement.

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