Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Oracle (https://www.clubdelphi.com/foros/forumdisplay.php?f=22)
-   -   Error en sentencia delete (https://www.clubdelphi.com/foros/showthread.php?t=11736)

febito 23-06-2004 21:12:46

Error en sentencia delete
 
estoy trabajnado con oracle 9i
la siguiente sentencia delete al ejecutrala devuelve 'comando sql no terminado correctamente'

DELETE TableOwner.ATRI
FROM TableOwner.ATRI A, TableOwner.GRUPO G, TableOwner.DE_GRU DG, TableOwner.LISTA_GRU_MUE LGM
WHERE A.IDGRU=G.IDGRU AND G.IDGRU=LGM.IDGRU AND LGM.IDMUE= :IDMUE AND DG.IDDEGRU=G.IDDEGRU AND DG.GLOBAL='N'

que error de sintaxis estoy cometiendo. Gracias

delphi.com.ar 23-06-2004 21:23:51

Sencillamente esta mal escrita. Las tres funciones DDL básicas (INSERT, DELETE y UPDATE), pueden apuntar solo a una tabla por vez. Si puedes en el where hacer referencia a otras tablas
Código SQL [-]
DELETE FROM TableOwner.ATRI 
WHERE EXISTS (SELECT 1 FROM TableOwner.GRUPO G, TableOwner.DE_GRU DG, TableOwner.LISTA_GRU_MUE LGM 
WHEREA.IDGRU=G.IDGRU AND G.IDGRU=LGM.IDGRU AND LGM.IDMUE= :IDMUE AND DG.IDDEGRU=G.IDDEGRU AND DG.GLOBAL='N')

Saludos!

febito 25-06-2004 15:23:50

Funciono bien, Muchas gracias


La franja horaria es GMT +2. Ahora son las 18:33:22.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi