Skip to main content

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

Request Parameters

ParameterTypeRequiredDescriptionExample
taskIdStringYesData comparison main task ID.cd-tg3isu1xgs
execIdIntegerYesExecution ID of a data comparison subtask.326816
progressIdIntegerYesUnique identifier of a single table comparison result.2934527
pageSizeIntegerNoNumber of records per page. The default value is 30, and the maximum value is 100.30
pageNumberIntegerNoPage number. The default value starts from 1.1

Response Parameters

ParameterTypeDescriptionExample
successBooleanWhether the request is successful.true
requestIdStringRequest ID, which can be used for troubleshooting and tracing.Zp7d2OLN-DJJKnOZnEELv6ZUdFHc8LBG
dataObjectCorrection SQL result object.See the field descriptions below

data Fields

ParameterTypeDescriptionExample
totalCountLongTotal number of correction SQL statements generated for inconsistent data in the current table.8
pageNumberIntegerReturned page number.1
pageSizeIntegerNumber of records per page.30
sqlRecordsArrayCorrection SQL list. Each object corresponds to one correction SQL statement.See the field descriptions below

sqlRecords Fields

ParameterTypeDescriptionExample
sqlStringCorrection 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 ;"
}
]
}
}