[Problema]Delete en varias tablas
Publicado por David (11 intervenciones) el 03/06/2015 21:49:00
Tengo un problema con este procedimiento el cual solo me borra datos de una tabla pero deja intactas las otras dos,creo que es un problema de sintaxis espero puedan ayudarme en esto,aquí está la sentencia:
1
2
3
4
5
6
7
8
9
10
11
PROCEDURE `PruebaEliminar`(in Rec longtext,in Id_Est integer(2),in Obs longtext,in Id_As integer(2),in Id_Emp integer(2),in Id_Dp integer (2),in Id_Re integer(2),Id_usu integer(2),Id_adj integer(2),in operacion varchar(1))
BEGIN
if operacion='U' then
update reclamos set Reclamo=Rec,Id_Est=Id_Est,Obs=Obs,Id_Dpto=Id_Dp,Id_Emp=id_Emp,Id_As=Id_As where Id_Reclamo=Id_Re;
end if;
if operacion='D' then
DELETE from reclamo WHERE id_reclamo=id_re;
Delete from usuarios where id_usuario=Id_usu;
Delete from adjuntos where id_adjunto=id_adj;
end if;
end
Valora esta pregunta


0