Lists SQL statements in an SQL review ticket and returns their review status and optimization suggestions.
Operation description
For more information about the SQL review feature, see SQL review.
Try it now
Test
RAM authorization
|
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 SQL review ticket ID. You can call the CreateSQLReviewOrder operation to obtain this ID. |
903**** |
| OrderActionDetail |
object |
No |
The filter criteria for SQL statements in the ticket. |
|
| FileId |
integer |
No |
The ID of the file that contains the SQL statements to review. |
85**** |
| SQLReviewResult |
string |
No |
The optimization suggestion for the SQL statement. Valid values:
|
MUST_IMPROVE |
| CheckStatusResult |
string |
No |
The review status of the SQL statement. Valid values:
|
check_not_pass |
| Page |
object |
No |
The pagination settings. |
|
| PageNumber |
integer |
No |
The page number. |
1 |
| PageSize |
integer |
No |
The number of entries per page. |
20 |
| Tid |
integer |
No |
The tenant ID. You can call the GetUserActiveTenant or ListUserTenants operation to obtain the tenant ID. |
233*** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
0A00863F-6366-5583-9B96-891DC8D8F88A |
| ErrorCode |
string |
The error code returned. |
UnknownError |
| ErrorMessage |
string |
The error message returned if the request failed. |
UnknownError |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| TotalCount |
integer |
The total number of SQL statements in the file. |
1 |
| OriginSQLList |
array<object> |
The parsed SQL statements. |
|
|
object |
|||
| SQLId |
integer |
The ID of the SQL statement. |
1111 |
| FileId |
integer |
The file ID. |
858*** |
| FileName |
string |
The name of the file. |
test.sql |
| SQLContent |
string |
The content of the SQL statement. |
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 review status of the SQL statement. Valid values:
|
check_pass |
| StatusDesc |
string |
The description of the review status. |
检测通过 |
| CheckedTime |
string |
The time when the SQL statement was reviewed. |
2021-06-09 21:07:00 |
| SqlHash |
string |
The MD5 hash of the SQL statement. |
c7992dc1b681c6733894aded7834f423 |
| ReviewSummary |
string |
The optimization suggestion statistics for the SQL statements, in JSON format. Valid values:
|
{\"SUGGEST_IMPROVE\":2,\"POTENTIAL_ISSUE\":1} |
| SQLReviewQueryKey |
string |
The key for querying optimization suggestion details. You can call the GetSQLReviewOptimizeDetail operation to query details based on this key. |
6e9a4bc6867a4174a96b23c8b48b**** |
| SQLName |
string |
The name of the SQL statement. |
getByPk |
Examples
Success response
JSON format
{
"RequestId": "0A00863F-6366-5583-9B96-891DC8D8F88A",
"ErrorCode": "UnknownError",
"ErrorMessage": "UnknownError",
"Success": true,
"TotalCount": 1,
"OriginSQLList": [
{
"SQLId": 1111,
"FileId": 0,
"FileName": "test.sql",
"SQLContent": "CREATE TABLE `test_sql_review_table` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `gmt_create` datetime NOT NULL,\n `name` varchar(256) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;",
"CheckStatus": "check_pass",
"StatusDesc": "检测通过",
"CheckedTime": "2021-06-09 21:07:00",
"SqlHash": "c7992dc1b681c6733894aded7834f423",
"ReviewSummary": "{\\\"SUGGEST_IMPROVE\\\":2,\\\"POTENTIAL_ISSUE\\\":1}",
"SQLReviewQueryKey": "6e9a4bc6867a4174a96b23c8b48b****",
"SQLName": "getByPk"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.