Take a look at htis modified method: Why eventually the column "complemento" is generated like this (enclosed by double quotes):
UPDATE centauro005.endereco SET identificacao = 'Cobrança',tipo_endereco = '1',data_cadastro = '2024-04-30 10:26:01',unidade_origem = '0',logradouro = 'ROD. ARY CAMPANHOLO',numero = 'S/N',"complemento = 'KM 1,5',bairro = 'CARDEAL'",municipio = 'ELIAS FAUSTO',uf = 'SP',cep = '13350000',cod_cidade_ibge = '3514908',pessoa_responsavel = 'Gustavo',referencia = '',codigo_obra = '',endereco_ativo = 'True',end_envio_boleto = 'True',uuid_endereco = 0x0192F9A5FB347FF7A9767DD9133492C3 WHERE endereco_id = 4078 AND cliente_id = 1626;

procedure GenerateUpdateScriptsForOldDataCadastro;

function BytesToHex(const Bytes: TBytes): string;
var
  i: Integer;
begin
  Result := '';
  for i := 0 to Length(Bytes) - 1 do
    Result := Result + IntToHex(Bytes[i], 2);
end;

function FormatSQLValue(const Value: Variant; const FieldType: TFieldType): string;
begin
  if VarIsNull(Value) or VarIsEmpty(Value) then
    Result := 'NULL'
  else
    case FieldType of
      ftString, ftWideString, ftMemo, ftWideMemo, ftFixedChar, ftFixedWideChar:
        Result := QuotedStr(Trim(VarToStr(Value)));
      ftDate, ftDateTime, ftTime:
        Result := QuotedStr(FormatDateTime('yyyy-mm-dd hh:nn:ss', Value));
      ftInteger, ftSmallint, ftWord, ftLargeint, ftAutoInc, ftFloat, ftCurrency, ftBCD, ftFMTBcd:
        Result := VarToStr(Value);
      ftBytes, ftVarBytes, ftBlob, ftGraphic, ftOraBlob, ftOraClob, ftParadoxOle, ftDBaseOle:
        if VarIsArray(Value) then
          Result := '0x' + BytesToHex(Value)
        else
          Result := 'NULL';
      else
        Result := QuotedStr(VarToStr(Value));
    end;
end;

function GenerateSetClause(const FieldName: string; const Value: Variant; FieldType: TFieldType): string;
begin
  Result := FieldName + ' = ' + FormatSQLValue(Value, FieldType);
end;

var
  QueryStore1, QueryStore2: TUniQuery;
  ScriptFile, ReportFile: TextFile;
  ScriptFileName, ReportFileName: string;
  enderecoId, clienteId: Integer;
  dataCadastro1, dataCadastro2: TDateTime;
  isStore1Newer: Boolean;
  FieldList: TStringList;
  i: Integer;
  FieldName: string;
  ValueStore1, ValueStore2: Variant;
  FieldType: TFieldType;
  Connection: TUniConnection;
  Store2Keys: TDictionary<string, TDateTime>;
  CompositeKey: string;
  SourceQuery, TargetQuery: TUniQuery;
  SetClauses: TStringList;
  sqlUpdate: string;
begin
  ScriptFileName := 'update_data_cadastro.sql';
  ReportFileName := 'update_data_cadastro_report.txt';

  AssignFile(ScriptFile, ScriptFileName);
  Rewrite(ScriptFile);

  AssignFile(ReportFile, ReportFileName);
  Rewrite(ReportFile);

  QueryStore1 := nil;
  QueryStore2 := nil;
  Store2Keys := nil;
  SourceQuery := nil;
  TargetQuery := nil;
  FieldList := nil;
  SetClauses := nil;

  try
    WriteLn(ReportFile, 'Update Scripts for endereco Records with Older data_cadastro');
    WriteLn(ReportFile, 'Generated on: ' + DateTimeToStr(Now));
    WriteLn(ReportFile, '--------------------------------------------------------');
    WriteLn(ReportFile, '');

    Connection := DM.LocalServer;
    if not Assigned(Connection) or not Connection.Connected then
      raise Exception.Create('Database connection not available');

    Store2Keys := TDictionary<string, TDateTime>.Create;
    QueryStore1 := TUniQuery.Create(nil);
    QueryStore2 := TUniQuery.Create(nil);

    QueryStore1.Connection := Connection;
    QueryStore2.Connection := Connection;

    QueryStore1.SQL.Text :=
      'SELECT endereco_id, cliente_id, data_cadastro ' +
      'FROM centauro001.endereco';

    QueryStore2.SQL.Text :=
      'SELECT endereco_id, cliente_id, data_cadastro ' +
      'FROM centauro005.endereco';

    QueryStore1.Open;
    QueryStore2.Open;

    while not QueryStore2.EOF do
    begin
      enderecoId := QueryStore2.FieldByName('endereco_id').AsInteger;
      clienteId := QueryStore2.FieldByName('cliente_id').AsInteger;
      dataCadastro2 := QueryStore2.FieldByName('data_cadastro').AsDateTime;

      CompositeKey := Format('%d:%d', [enderecoId, clienteId]);
      if not Store2Keys.ContainsKey(CompositeKey) then
        Store2Keys.Add(CompositeKey, dataCadastro2)
      else
        WriteLn(ReportFile, Format(
          'Duplicate key found in store2 for endereco_id=%d and cliente_id=%d.',
          [enderecoId, clienteId]));

      QueryStore2.Next;
    end;

    QueryStore1.First;
    while not QueryStore1.EOF do
    begin
      enderecoId := QueryStore1.FieldByName('endereco_id').AsInteger;
      clienteId := QueryStore1.FieldByName('cliente_id').AsInteger;
      dataCadastro1 := QueryStore1.FieldByName('data_cadastro').AsDateTime;

      CompositeKey := Format('%d:%d', [enderecoId, clienteId]);

      if Store2Keys.ContainsKey(CompositeKey) then
      begin
        dataCadastro2 := Store2Keys[CompositeKey];

        if dataCadastro1 <> dataCadastro2 then
        begin
          isStore1Newer := dataCadastro1 > dataCadastro2;

          FreeAndNil(SourceQuery);
          SourceQuery := TUniQuery.Create(nil);
          SourceQuery.Connection := Connection;

          if isStore1Newer then
            SourceQuery.SQL.Text := 'SELECT * FROM centauro001.endereco WHERE endereco_id = :id AND cliente_id = :cid'
          else
            SourceQuery.SQL.Text := 'SELECT * FROM centauro005.endereco WHERE endereco_id = :id AND cliente_id = :cid';

          SourceQuery.ParamByName('id').AsInteger := enderecoId;
          SourceQuery.ParamByName('cid').AsInteger := clienteId;
          SourceQuery.Open;

          if not SourceQuery.IsEmpty then
          begin
            FreeAndNil(TargetQuery);
            TargetQuery := TUniQuery.Create(nil);
            TargetQuery.Connection := Connection;

            if isStore1Newer then
              TargetQuery.SQL.Text := 'SELECT * FROM centauro005.endereco WHERE endereco_id = :id AND cliente_id = :cid'
            else
              TargetQuery.SQL.Text := 'SELECT * FROM centauro001.endereco WHERE endereco_id = :id AND cliente_id = :cid';

            TargetQuery.ParamByName('id').AsInteger := enderecoId;
            TargetQuery.ParamByName('cid').AsInteger := clienteId;
            TargetQuery.Open;

            if not TargetQuery.IsEmpty then
            begin
              FreeAndNil(FieldList);
              FieldList := TStringList.Create;

              for i := 0 to SourceQuery.FieldCount - 1 do
              begin
                FieldName := SourceQuery.Fields[i].FieldName;
                if (FieldName <> 'endereco_id') and (FieldName <> 'cliente_id') then
                  FieldList.Add(FieldName);
              end;

              sqlUpdate := Format('UPDATE %s.endereco SET ',
                [IfThen(isStore1Newer, 'centauro005', 'centauro001')]);

              FreeAndNil(SetClauses);
              SetClauses := TStringList.Create;
              SetClauses.Delimiter := ',';
              SetClauses.StrictDelimiter := True;

              for i := 0 to FieldList.Count - 1 do
              begin
                FieldName := FieldList[i];
                FieldType := SourceQuery.FieldByName(FieldName).DataType;
                SetClauses.Add(GenerateSetClause(FieldName,
                  SourceQuery.FieldByName(FieldName).Value, FieldType));
              end;

              sqlUpdate := sqlUpdate + SetClauses.DelimitedText +
                Format(' WHERE endereco_id = %d AND cliente_id = %d;',
                  [enderecoId, clienteId]);

              WriteLn(ScriptFile, sqlUpdate);
              {
              WriteLn(ReportFile, Format(
                'endereco_id=%d, cliente_id=%d: Updated %s.endereco (data_cadastro=%s) ' +
                'with data from %s.endereco (data_cadastro=%s)',
                [enderecoId, clienteId,
                 IfThen(isStore1Newer, 'store2', 'store1'),
                 DateTimeToStr(IfThen(isStore1Newer, dataCadastro2, dataCadastro1)),
                 IfThen(isStore1Newer, 'store1', 'store2'),
                 DateTimeToStr(IfThen(isStore1Newer, dataCadastro1, dataCadastro2))]));
              }
              WriteLn(ReportFile, sqlUpdate);
              WriteLn(ReportFile, '--------------------------------------------------------');
            end;
          end;
        end;
      end;
      QueryStore1.Next;
    end;

  finally
    FreeAndNil(SetClauses);
    FreeAndNil(FieldList);
    FreeAndNil(TargetQuery);
    FreeAndNil(SourceQuery);
    FreeAndNil(Store2Keys);
    FreeAndNil(QueryStore2);
    FreeAndNil(QueryStore1);
    CloseFile(ScriptFile);
    CloseFile(ReportFile);
  end;

  ShowMessage('Update scripts and report have been generated successfully.' + sLineBreak +
    'Script File: ' + ScriptFileName + sLineBreak +
    'Report File: ' + ReportFileName);
end;