All Products
Search
Document Center

Data Management:ListSQLReviewOriginSQL

Last Updated:Oct 19, 2026

Retrieves the SQL details of an SQL review ticket.

Operation description

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:ListSQLReviewOriginSQL

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

OrderId

integer

Yes

The ID of the SQL review ticket. You can call the CreateSQLReviewOrder operation to obtain this parameter.

903****

OrderActionDetail

object

No

The ticket parameters (filter conditions).

FileId

integer

No

The ID of the reviewed file.

85****

SQLReviewResult

string

No

The SQL review optimization suggestions. Valid values:

  • MUST_IMPROVE: must be improved

  • POTENTIAL_ISSUE: potential issue

  • SUGGEST_IMPROVE: suggested improvement

  • USE_DMS_TOOLKIT: use lock-free structure change

  • USE_DMS_DML_UNLOCK: use lock-free data change

  • TABLE_INDEX_SUGGEST: index recommendation

MUST_IMPROVE

CheckStatusResult

string

No

The check result. Valid values:

  • new: waiting for analysis

  • unknown: parsing exception

  • check_not_pass: check failed

  • check_pass: check passed

  • force_pass: manually approved

  • force_not_pass: manually rejected

check_not_pass

Page

object

No

The pagination parameters.

PageNumber

integer

No

The number of the page to return.

1

PageSize

integer

No

The number of entries to return on each page.

20

Tid

integer

No

The tenant ID. You can call the GetUserActiveTenant or ListUserTenants operation to obtain this parameter.

233***

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID, which is used to locate logs and troubleshoot issues.

0A00863F-6366-5583-9B96-891DC8D8F88A

ErrorCode

string

The error code.

UnknownError

ErrorMessage

string

The error message returned if the API call fails.

UnknownError

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

TotalCount

integer

The number of SQL statements contained in the file.

1

OriginSQLList

array<object>

The list of parsed SQL statements.

object

The details of a single SQL statement.

SQLId

integer

The ID of the SQL statement.

1111

FileId

integer

The ID of the file.

858***

FileName

string

The name of the file.

test.sql

SQLContent

string

The SQL content in the file.

CREATE TABLE `test_sql_review_table` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `gmt_create` datetime NOT NULL, `name` varchar(256) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CheckStatus

string

The check result. Valid values:

  • new: waiting for analysis

  • unknown: parsing exception

  • check_not_pass: check failed

  • check_pass: check passed

  • force_pass: manually approved

  • force_not_pass: manually rejected

check_pass

StatusDesc

string

The description of the check result.

Check passed

CheckedTime

string

The time when the SQL statement was checked.

2021-06-09 21:07:00

SqlHash

string

The value obtained by applying the MD5 hash algorithm to the SQL content.

c7992dc1b681c6733894aded7834f423

ReviewSummary

string

The statistics on SQL review optimization suggestions (JSON character string). Valid values:

  • MUST_IMPROVE: must be improved

  • POTENTIAL_ISSUE: potential issue

  • SUGGEST_IMPROVE: suggested improvement

  • USEDMSTOOLKIT: use lock-free structure change

  • USEDMSDML_UNLOCK: use lock-free data change

  • TABLEINDEXSUGGEST: index recommendation

{\"SUGGEST_IMPROVE\":2,\"POTENTIAL_ISSUE\":1}

SQLReviewQueryKey

string

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

6e9a4bc6867a4174a96b23c8b48b****

SQLName

string

The name of the SQL statement.

getByPk

Examples

Success response

JSON format

{
  "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.