4
When testing in the application where I migrated the BD from Firebird to Postgresql the following error occurs when trying to save an item in the database:
Reviewing the code I could see that the error actually occurs at this point in the code:
dmCadMib.Consulta_Cliente(Cliente); // Nessa Linha pula para a procedure Consulta_Cliente
dmCadMib.ConsClienteNoGrupo;
dmCadMib.localizaCliente(StrToInt(Cliente));
Procedure Consulta_Cliente:
procedure TdmCadMIB.Consulta_Cliente(Codigo: string);
begin
cdsEmpresa.Close;
sdsEmpresa.CommandText := 'select * from Empresa where Codigo =' + Codigo;
cdsEmpresa.Open;
end;
In which of the two Inserts gives the error? And you can debug and put the
string
formed the way it goes to BD?– Sorack
I edited the @Sorack question with the correct point where the error occurs
– R.Santos
Okay, but put the string formed by this, ie, what will effectively BD. It is syntax error, so it will be extremely simple to find the error
– Sorack
Beware of
cdsEmpresaNOME.AsString
, depending on what is in this variable can give syntax problem in SQL or worse. Instead, use parameters– Genos