Tema: ayuda sql
Ver Mensaje Individual
  #1  
Antiguo 08-04-2008
sargento elias sargento elias is offline
Miembro
 
Registrado: mar 2008
Posts: 109
Reputación: 19
sargento elias Va por buen camino
ayuda sql

Buenos días.Quiero hacer un borrado de CARTERA por filtro pasandome el cod.
Tabla CUENTA : id,cod.
Tabla CARTERA: id,idc,des.

este es el códigoLos demás filtros me funcionan).

Código SQL [-]
 

vsql:= 'DELETE FROM CARTERA ';
VWHE:='';
 
vsql:= vsql + 'INNER JOIN CUENTA ON CUENTA.ID = CARTERA.IDCTA ';
                    if Fvacio(Edesde.Text)=false then
                    begin
                          if vwhe <> '' then
                              vwhe:= vwhe + ' and  CUENTA.COD >='+ quotedstr(Edesde.text)
                          else
                              vwhe:= 'where CUENTA.COD >='+ quotedstr(Edesde.text);
                    end;
                    if Fvacio(Ehasta.Text)=false then
                    begin
                          if vwhe <> '' then
                              vwhe:= vwhe + ' and  CUENTA.COD <='+ quotedstr(Ehasta.text)
                          else
                              vwhe:= 'where CUENTA.COD <='+ quotedstr(Ehasta.text);
                    end;
vsql:=vsql + vwhe;
ib.Active:=false;
ib.DELETESQL.Clear;
 ib.DELETESQL.Text:=vsql;
 ib.active:=true;
 ib.Delete;
t.commit;

y este es el error:

Dynamic Sql error sql = -104 token unknow line 1,char 21 INNER'

Seguro que es una gilipollez pero no lo veo.
Responder Con Cita