Duvidas para fazer um insert pelo Delphi
18/02/2016
0
Boa tarde Galera
Sou iniciante no em programação
e estou trabalhando com o Delphi 2010
O Meu problema é o seguinte
Eu busco alguns Fields q estão em nuvem e exibo todos em um grid
ate ai OK
depos eu faço updates neles no meu banco local
ate ai tb esta OK
Mas tenho alguns produtos q estão na tabela q tenho q fazer
um Insert e não estou conseguindo
O algoritmo q estou o usando é esse
Sou iniciante no em programação
e estou trabalhando com o Delphi 2010
O Meu problema é o seguinte
Eu busco alguns Fields q estão em nuvem e exibo todos em um grid
ate ai OK
depos eu faço updates neles no meu banco local
ate ai tb esta OK
Mas tenho alguns produtos q estão na tabela q tenho q fazer
um Insert e não estou conseguindo
O algoritmo q estou o usando é esse
while Str <> '$' do begin begin while i < cds_1.Fields.Count do begin Delete(Str,1,Pos('|',Str)); strPRODUTO := QuotedStr(Copy(Str,1,Pos('#',Str) -1)); if cds_1.Fields.Fields[i].FieldName <> 'CODIGO' then begin DM.ibAUX.SQL.Text := ('UPDATE PRODUTO SET ' + cds_1.Fields.Fields[i].FieldName + ' = ' +Replace(strPRODUTO,',','.')+ ' WHERE REFERENCIA = ' + IntToStr(j + 1)); DM.ibAUX.ExecSQL; DM.ibAUX.ApplyUpdates; DM.TRANS.CommitRetaining; end; i := i + 1; end; i := 0; j := j + 1; Delete(Str,1,Pos('#',Str)); end; end;
Murilo Peixoto
Curtir tópico
+ 0
Responder
Posts
Clique aqui para fazer login e interagir na Comunidade :)