Ver Mensaje Individual
  #2  
Antiguo 05-12-2013
vicvil vicvil is offline
Miembro
 
Registrado: may 2003
Ubicación: Chile
Posts: 160
Reputación: 24
vicvil Va por buen camino
Smile

Bueno me respondo a mi mismo...

Despues de investigar un rato logré dar con la solución, que consiste en indicar los campos en que iría cada dato del archivo y con un SET llenar el último campo.
la sintaxis entonces quedaría asi:

Código SQL [-]
  if OpDg.Execute then
  begin
    sql:= 'load data local infile ' + '''' + OpDg.FileName + '''';
    sql:= StrTran(sql,'\','/'); (esta funcion cambia el '\' por el '/')
    qry.sql.clear;
    qry.sql.add(sql + ' Replace into table Tabla1 fields terminated by '','' lines  terminated by ''\r\n''');
    Replace into table formfact fields terminated by '','' lines terminated by ''\r\n''');
sql:='(nombre,ano_nacimiento,genero,est_civil,hijos,@seccion) SET seccion=('''+codseccion+''')';{codseccion es una variable ingresada por el usuario}
  qry.sql.add(sql);
    qry.ExecSQL;
    qry.close;
  end;

Lo probé y funcionó bien, asi que esto puede ayudar a alguien que pueda tener el mismo problema alguna vez.
Responder Con Cita