Query Data Comparison Correction SQL
Query correction SQL statements for inconsistent data in a specified table. You can execute the returned SQL statements on the target side to correct the data.
Request URL: /openapi/v1/comparedata/result/correctionSql
Request Method: GET
Before You Call
taskIdandexecIdcan be confirmed from the request context of Query Data Comparison Table Summary.progressIdcan be obtained fromdata.tableSummaries[].progressIdreturned by Query Data Comparison Table Summary.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| taskId | String | Yes | Data comparison main task ID. | cd-tg3isu1xgs |
| execId | Integer | Yes | Execution ID of a data comparison subtask. | 326816 |
| progressId | Integer | Yes | Unique identifier of a single table comparison result. | 2934527 |
| pageSize | Integer | No | Number of records per page. The default value is 30, and the maximum value is 100. | 30 |
| pageNumber | Integer | No | Page number. The default value starts from 1. | 1 |
Response Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | Whether the request is successful. | true |
| requestId | String | Request ID, which can be used for troubleshooting and tracing. | Zp7d2OLN-DJJKnOZnEELv6ZUdFHc8LBG |
| data | Object | Correction SQL result object. | See the field descriptions below |
data Fields
| Parameter | Type | Description | Example |
|---|---|---|---|
| totalCount | Long | Total number of correction SQL statements generated for inconsistent data in the current table. | 8 |
| pageNumber | Integer | Returned page number. | 1 |
| pageSize | Integer | Number of records per page. | 30 |
| sqlRecords | Array | Correction SQL list. Each object corresponds to one correction SQL statement. | See the field descriptions below |
sqlRecords Fields
| Parameter | Type | Description | Example |
|---|---|---|---|
| sql | String | Correction SQL statement. | update a2a.t_popup_control_target set popup_name='full5' where origin_id=4745 limit 1 ; |
Request Example
{
"taskId": "cd-tg3isu1xgs",
"execId": 326816,
"progressId": 2934527,
"pageNumber": 1,
"pageSize": 30
}
Successful Invocation Example
{
"success": true,
"requestId": "Zp7d2OLN-DJJKnOZnEELv6ZUdFHc8LBG",
"data": {
"totalCount": 8,
"pageNumber": 1,
"pageSize": 30,
"sqlRecords": [
{
"sql": "delete from `a2a`.`t_popup_control_target` where `origin_id`=3 limit 1 ;"
},
{
"sql": "insert into `a2a`.`t_popup_control_target` (`popup_name`, `app_id`, `origin_id`) values ('full6', 'eufy_security', 4746);"
},
{
"sql": "update `a2a`.`t_popup_control_target` set `popup_name`='full5' where `origin_id`=4745 limit 1 ;"
}
]
}
}