tengo un problema al crear procedure en mysql query browser version 5.5.16
no crea el procedure error 1064 de sintaxys en linea 1 y 24
Cita:
DROP PROCEDURE IF EXISTS `db_clinica`.`sp_ListaFichaAtencion` $$
CREATE PROCEDURE `db_clinica`.`sp_ListaFichaAtencion`(
IN apellidop VARCHAR(50),
IN documento INT,
IN ndocumento VARCHAR(15) ,
in nombre varchar(50)
)
BEGIN
Select f.cod_FA as id, concat(d.nom_HC , ' ' , d.ape_HC) as nombre_paciente,
concat(c.nom_med , ' ' , c.apep_med) as nombre_medico,
f.dur_FA as duracion,
f.ses_FA as sesion
From tb_fichaatencion f
inner join tb_medico c
on f.cod_med = c.cod_med
inner join tb_HistoriaClinica d
on f.cod_HC = d.cod_HC and
d.ape_HC = (case apellidop when '' then d.ape_HC else apellidop end) and
d.cod_doc = (case documento when '' then d.cod_doc else documento end) and
d.ndoc_HC = (case ndocumento when '' then d.ndoc_HC else ndocumento end) and
d.nom_HC like (case nombre when '' then d.nom_HC else nombre end);
END $$
DELIMITER ;
CREATE PROCEDURE `db_clinica`.`sp_ListaFichaAtencion`(
IN apellidop VARCHAR(50),
IN documento INT,
IN ndocumento VARCHAR(15) ,
in nombre varchar(50)
)
BEGIN
Select f.cod_FA as id, concat(d.nom_HC , ' ' , d.ape_HC) as nombre_paciente,
concat(c.nom_med , ' ' , c.apep_med) as nombre_medico,
f.dur_FA as duracion,
f.ses_FA as sesion
From tb_fichaatencion f
inner join tb_medico c
on f.cod_med = c.cod_med
inner join tb_HistoriaClinica d
on f.cod_HC = d.cod_HC and
d.ape_HC = (case apellidop when '' then d.ape_HC else apellidop end) and
d.cod_doc = (case documento when '' then d.cod_doc else documento end) and
d.ndoc_HC = (case ndocumento when '' then d.ndoc_HC else ndocumento end) and
d.nom_HC like (case nombre when '' then d.nom_HC else nombre end);
END $$
DELIMITER ;
pero este otro procedure si ejecuta y lo crea
Cita:
DROP PROCEDURE IF EXISTS `db_clinica`.`sp_ValidaUsuario` $$
CREATE PROCEDURE `db_clinica`.`sp_ValidaUsuario`(
IN usuario VARCHAR(20),
IN password VARCHAR(15)
)
BEGIN
Select a.cod_usu as codigo,
a.ussu as usuario,
a.pas_usu as password,
a.cod_per as perfil,
b.des_per as des_perfil
From tb_usuario a
inner join tb_perfil b
on a.cod_per = b.cod_per
where ussu = usuario and pas_usu = password;
END $$
DELIMITER;
CREATE PROCEDURE `db_clinica`.`sp_ValidaUsuario`(
IN usuario VARCHAR(20),
IN password VARCHAR(15)
)
BEGIN
Select a.cod_usu as codigo,
a.ussu as usuario,
a.pas_usu as password,
a.cod_per as perfil,
b.des_per as des_perfil
From tb_usuario a
inner join tb_perfil b
on a.cod_per = b.cod_per
where ussu = usuario and pas_usu = password;
END $$
DELIMITER;