Ver Mensaje Individual
  #12  
Antiguo 10-11-2011
L3st4t L3st4t is offline
Miembro
 
Registrado: feb 2008
Posts: 24
Reputación: 0
L3st4t Va por buen camino
Codigo Incompleto

Código Delphi [-]
Procedure TF_CargosA.InsertaRegistros;
var fccodigo : string;
begin
  with DataM.Q_Clientes do
  begin
   while not Eof do
   begin;
   //First;
  DataM.Q_Clientes.SQL.Clear;
  DataM.Q_Clientes.Close;
  DataM.Q_Clientes.SQL.Add('SELECT FC_CODIGO FROM SCLIENTES');
  DataM.Q_Clientes.ExecSQL;
  fccodigo := FieldByName('FC_CODIGO').AsString;
  end;
    With DataM.Q_CargosF do
    begin
    Next;
  DataM.Q_CargosF.SQL.Clear;
  DataM.Q_CargosF.Close;
  DataM.Q_CargosF.SQL.Add('INSERT INTO SCARGOSFIJOS  (FCF_CLIENTE,FCF_CODIGOPRODUCTO)');
  DataM.Q_CargosF.SQL.Add('VALUES  (aram1, aram2)');
  DataM.Q_CargosF.ParamByName('param1').AsString := fccodigo;
  DataM.Q_CargosF.ParamByName('param2').AsString := Edit1.Text;
  DataM.Q_CargosF.ExecSQL;
    end;
  end; //while

end;

Saludos

Lepe estuve probando el código que me diste pero no me funciono, pero fue porque no me explique bien. pero bueno decidí echarle un poco por mi lado y obtuve el que me muestro arriba, me funciona bien pero tengo problemas con el while, no logro que lo haga mas de una vez, solo me inserta el primer registro en la fila...Que esta mal?

Gracias
Responder Con Cita