ExecSQL - String to long?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
SsurferR
Posts: 3
Joined: Mon 05 Sep 2011 15:52

ExecSQL - String to long?

Post by SsurferR » Thu 24 Nov 2011 20:04

Trying to insert into table and getting a string is to long from ExecSQL in delphi/Unidac, tryed to split the strings with + but getting wierd error.

Is there a way around when the string is to long for ExecSQL to work properlly?

thx you in advance.

Code: Select all

function TdtmCGM.AtualizarJuridica(RazaoSocial, NomeFantasia, CNPJ, Email,
  Contato, WebSite, Observacao, UF, Cidade, Bairro, Logradouro, Complemento,
  UFInscricaoEstadual: String; CEP, Numero, CaixaPostal, TelRamal: Integer;
  InscricaoEstadual, TelResidencial, TelComercial, TelCelular,
  CodJuridica: Double; DataCadastro: TDate): Boolean;
begin
  Result := True;
  dtmCGM.conCGMDB.StartTransaction;
  with dtmCGM.conCGMDB do
    begin
      try
        Open;
        begin
          ExecSQL('UPDATE juridica SET  razaosocial = : RazaoSocial, nomefantasia =: NomeFantasia, cnpj = :CNPJ, email = :Email, contato = :Contato, website = :WebSite, observacao = :Observacao, uf = :UF, cidade = :Cidade, bairro = :Bairro, logradouro = :Logradouro,'
          +' complemento = :Complemento, ufinscricaoestadual = :UFInscricaoEstadual, cep = :CEP, numero = :Numero, caixapostal = :CaixaPostal, telramal = :TelRamal, inscricaoestadual = :InscricaoEstadual, telresidencial = :TelResidencial,'
          +' telcomercial = :TelComercial, telcelular = :TelCelular, datacadastro = :DataCadastro WHERE codjuridica = :CodJuridica',[RazaoSocial, NomeFantasia, CNPJ, Email, Contato, WebSite, Observacao, UF, Cidade, Bairro, Logradouro, Complemento, UFInscricaoEstadual, CEP, Numero, CaixaPostal, TelRamal, InscricaoEstadual, TelResidencial, TelComercial, TelCelular, CodJuridica, DataCadastro]);
        end;
        Commit;
        Close;
      except
        Result := False;
        conCGMDB.Rollback;
        Close;
        raise;
      end;
    end;
end;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 25 Nov 2011 12:23

Hello,

Please specify the following information so that I am able to help you:
- the exact version of UniDAC;
- the name and the version of your IDE;
- the name of your database.

Post Reply