Call the ListSQLReviewOriginSQL to obtain the SQL details of the SQL audit ticket.

For more instructions on this feature, see SQL audit .

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 ListSQLReviewOriginSQL

The system specifies the parameters. Valid values: ListSQLReviewOriginSQL .

OrderId Long Yes 123321

ticket number, you can call CreateSQLReviewOrder The interface obtains the parameter.

OrderActionDetail Object No

Job parameters (filter conditions).

FileId Long No 123345

The audit file ID.

SQLReviewResult String No MUST_IMPROVE

SQL audit optimization suggestions, the value is as follows:

  • MUST_IMPROVE : Must be improved
  • POTENTIAL_ISSUE : Potential issues
  • SUGGEST_IMPROVE : Suggested improvements
  • USE_DMS_TOOLKIT : Use lockless structure changes
  • USE_DMS_DML_UNLOCK : changes with lock-free data
  • TABLE_INDEX_SUGGEST : index recommendation
CheckStatusResult String No check_not_pass

The test result is as follows:

  • new : waiting for analysis
  • unknown : parse exceptions
  • check_not_pass : detection fails
  • check_pass : detection passed
  • force_pass : manual pass
  • force_not_pass : manual failure
Page Object No

The page to return.

PageNumber Integer No 1

The page number of the returned page.

PageSize Integer No 20

The amount of data per page.

Tid Long No 1

The tenant ID, you can call GetUserActiveTenant or ListUserTenants The interface obtains the parameter.

RegionId String No cn-hangzhou

Select the service region of DMS to call the interface. For the value, see RegionID parameter description .

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

Response parameters

Parameter Type Example Description
RequestId String 0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

Id of the request

ErrorCode String UnknownError

The error code returned.

ErrorMessage String UnknownError

The error message that is returned.

Success Boolean true

Indicates whether the request is successful.

TotalCount Integer 10

The total number of SQL entries. Unit: entries.

OriginSQLList Array of OriginSQLList

The list of parsed SQL statements.

SQLId Long 1111

The SQL statement ID.

FileId Long 123321

The ID of the file.

FileName String test.sql

The name of the file.

SQLContent String select id from table_name

The SQL content.

CheckStatus String check_pass

The test result is as follows:

  • new : waiting for analysis
  • unknown : parse exceptions
  • check_not_pass : detection fails
  • check_pass : detection passed
  • force_pass : manual pass
  • force_not_pass : manual failure
StatusDesc String Detection Pass

The description of the detection result.

CheckedTime String 2021-06-09 21:07:00

The detection time.

Examples

Sample requests


     http(s)://[Endpoint]/?Action=ListSQLReviewOriginSQL &OrderId=123321 &OrderActionDetail={"FileId":123345,"SQLReviewResult":"MUST_IMPROVE","CheckStatusResult":"check_not_pass","Page":{"PageNumber":1,"PageSize":20}} &Tid=1&Public request parameters 
   

Sample success responses

XML format


     HTTP/1.1 200 OK Content-Type:application/xml <ListSQLReviewOriginSQLResponse> <TotalCount>2</TotalCount> <RequestId>0F4AB890-9EC4-434D-8D20-D43B6D874F0D</RequestId> <Success>true</Success> <OriginSQLList> <StatusDesc>Failure</StatusDesc> <SQLContent>DELETE FROM test_sql_review_table</SQLContent> <CheckedTime>2021-04-22 14:03:43</CheckedTime> <FileName>MyBatis_test.xml</FileName> <CheckStatus>check_not_pass</CheckStatus> <FileId>12733</FileId> <SQLId>115621</SQLId> </OriginSQLList> <OriginSQLList> <StatusDesc>Detection passed</StatusDesc> <SQLContent>SELECT id, gmt_create, gmt_modified, detail_id, name , db_id, is_delete, file_content_id FROM test_sql_review_table sf WHERE id = ${pk}</SQLContent> <CheckedTime>2021-04-22 14:03:43</CheckedTime> <FileName>MyBatis_test.xml</FileName> <CheckStatus>check_pass</CheckStatus> <FileId>12733</FileId> <SQLId>115622</SQLId> </OriginSQLList> </ListSQLReviewOriginSQLResponse> 
   

JSON format


     HTTP/1.1 200 OK Content-Type:application/json { "TotalCount" : 2, "RequestId" : "0F4AB890-9EC4-434D-8D20-D43B6D874F0D", "Success" : true, "OriginSQLList" : [ { "StatusDesc" : "Failure", "SQLContent" : "DELETE FROM test_sql_review_table", "CheckedTime" : "2021-04-22 14:03:43", "FileName" : "MyBatis_test.xml", "CheckStatus" : "check_not_pass", "FileId" : 12733, "SQLId" : 115621 }, { "StatusDesc" : "Detection passed", "SQLContent" : "SELECT id, gmt_create, gmt_modified, detail_id, name\n\t, db_id, is_delete, file_content_id\nFROM test_sql_review_table sf\nWHERE id = ${pk}", "CheckedTime" : "2021-04-22 14:03:43", "FileName" : "MyBatis_test.xml", "CheckStatus" : "check_pass", "FileId" : 12733, "SQLId" : 115622 } ] } 
   

Error code

Go to the Error Center View more error codes.