Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/05/2012, 10:06
Avatar de djaevi
djaevi
 
Fecha de Ingreso: marzo-2007
Ubicación: Moreno, Buenos Aires
Mensajes: 400
Antigüedad: 17 años, 2 meses
Puntos: 47
Respuesta: Tratar Errores

Bueno investigue un poco mas y di con la solucion se trata de declarar un handler para los errores les dejo el codigo por si a alguien le sirve;

Código SQL:
Ver original
  1. DELIMITER $$;
  2.  
  3. CREATE PROCEDURE `bd`.`proceed`()
  4.  
  5. BEGIN
  6.  
  7. DECLARE EXIT HANDLER
  8.     FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
  9.         ROLLBACK TO PUNTO;
  10.  
  11. START TRANSACTION;
  12.  
  13. SAVEPOINT PUNTO;
  14.  
  15. INSERT INTO tabla1 (nombre) VALUES ("Pedro");
  16. INSERT INTO tabla1 (nombre) VALUES ("Juan");
  17. INSERT INTO tabla1 (nombre) VALUES (150); # En esta linea restorarara todo al inicio osea al SAVEPOINT PUNTO
  18.  
  19. END