Skip to main content

Query Schema Comparison Correction SQL

Use this API to query correction SQL for a single inconsistent object in a schema comparison task.

Request URL: /openapi/v1/compareschema/result/correctionSql

Request Method: GET

Before You Call​

Request Parameters​

ParameterTypeRequiredDescriptionExample
taskIdStringYesSchema comparison main task ID.cc-th6j3fs58y
execIdLongYesSchema comparison subtask ID.46958
progressIdIntegerYesResult identifier for a single object.388425

Response Parameters​

ParameterTypeDescriptionExample
successBooleanWhether the request is successful.true
requestIdStringRequest ID, which can be used for troubleshooting and tracing.Kr1p2NXI-djkepBRnfjjt3XUdeky7BMG
dataObjectCorrection SQL result. See the fields below.See the example below
messageStringError message returned when the request fails.progressId does not belong to execId

data Fields​

ParameterTypeDescriptionExample
correctSqlStringCorrection SQL generated for the object.CREATE TABLE ...;

Request Example​

{
"taskId": "cc-th6j3fs58y",
"execId": 46958,
"progressId": 388425
}

Successful Invocation Example​

{
"success": true,
"requestId": "Kr1p2NXI-djkepBRnfjjt3XUdeky7BMG",
"data": {
"correctSql": "CREATE TABLE `sbtest1` (...);"
}
}

Result​

A successful response returns the generated correction SQL for the selected object. Review the returned statement before applying it on the target side.