Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/09/2012, 09:33
Avatar de gnzsoloyo
gnzsoloyo
Moderador criollo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Actualmente en Buenos Aires (el enemigo ancestral)
Mensajes: 23.324
Antigüedad: 17 años, 3 meses
Puntos: 2658
Respuesta: Como Subir TRIGGER a un hosting

¿Con esto también?:
Código MySQL:
Ver original
  1. DELIMITER $$
  2.  
  3. TRIGGER `trigger_cotizacion` BEFORE INSERT ON `cotizacion`
  4.     SET NEW.id_cotizacion  =
  5.     (SELECT IFNULL(MAX(a.id_cotizacion),0)+1
  6.     FROM `cotizacion` a
  7.     WHERE YEAR(a.fecha_id)= YEAR(NEW.fecha));
  8.     SET NEW.fecha_id = NEW.fecha);
  9. END $$
  10.  
  11. DELIMITER ;
__________________
¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...
"El problema es la interfase silla-teclado." (Gillermo Luque)