Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/10/2005, 14:21
Avatar de moron
moron
 
Fecha de Ingreso: mayo-2004
Mensajes: 972
Antigüedad: 20 años
Puntos: 2
Stored Procedure

Hola gente:
Estoy pasandome de m$$ql a mysql, con la "ayuda" del mysql query pude hacer algunos SP de prueba sencillos, pero cuando empiezo a complicarlos aparecen errores.
De paso, si alguien sabe de un buen manual de Stored Procedure para mysql se los voy a agradecer.

El siguiente es el codigo del sp:


DELIMITER $$

DROP PROCEDURE IF EXISTS `prueba`.`V100_SP_TB_Prueba_AM`$$
CREATE PROCEDURE `prueba`.`V100_SP_TB_Prueba_AM`
(in accion varchar(1),
in idReg int,
in nroBBC int,
in fraccion int,
in nroSerie float
)
BEGIN
if accion= 'A'
begin
insert into prueba values (nroBBC,fraccion,
nroSerie)
end

if accion = 'M'
begin
update prueba set roBBC=roBBC,fraccion=fraccion, nroSerie = nroSerie where idReg= idReg

end
END$$

DELIMITER ;


me tira error near el begin del primer IF

muchas gracias desde ya
saludos.