Fórum TFDQuery #572018
02/12/2016
0
with dm.sql_update_dpto do
begin
Close;
SQL.Clear;
SQL.Add('select ID_DPTO_P from EQ_DPTO Where ID_DPTO='+dm.sql_depto_NEREUS.FieldByName('ID').AsString);
Open;
Edit;
FieldByName('ID_DPTO_P').Value := dm.sql_grp.FieldByName('ID').AsInteger;
try
Post;
except
On E:Exception do
ShowMessage(E.Message);
end;
end;
end;
Bruno
Curtir tópico
+ 0Post mais votado
02/12/2016
Mais veja
ID_DPTO_P = x
ID_DPTO =y
ID_DPTO_P =ID_DPTO_P
ID_DPTO =ID_DPTO
Ou seja você está dizendo que o campo ID vai ser igual a ele mesmo quando ele for igual a ele?
Veja
update EQ_DPTO set x=:x Where y=:y
Raimundo Pereira
Gostei + 1
Mais Posts
02/12/2016
Douglas
Posta o código do erro :)
Assim fica mais fácil de ajudar.
Abração.
Gostei + 0
02/12/2016
Bruno
Gostei + 0
02/12/2016
Bruno
var1 := dm.sql_grp.FieldByName(''ID'').AsString;
var2 := dm.sql_depto.FieldByName(''ID'').AsString;
with dm.sql_update_dpto do
begin
Close;
SQL.Clear;
SQL.Add(''update EQ_DPTO set ID_DPTO_P=:ID_DPTO_P Where ID_DPTO=:ID_DPTO'');
ParamByName(''ID_DPTO_P'').Value := var1;
ParamByName(''ID_DPTO'').Value := var2;
try
ExecSQL;
except
On E:Exception do
ShowMessage(E.Message);
end;
end;
e deu o seguinte erro:
[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 11.0][Sql Server]A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstating result set wa active.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)