我在stored procedure
中有以下mysql
:
DELIMITER $$
CREATE DEFINER=`user`@`localhost` PROCEDURE `insert_patient`(IN `name` VARCHAR(45), IN `surname` VARCHAR(45), IN `middle_name` VARCHAR(45), IN `patient_gender` VARCHAR(15), IN `patient_weight` VARCHAR(15), IN `patient_height` VARCHAR(15), IN `patient_ethnic_origin` VARCHAR(45))
NO SQL
BEGIN
BEGIN
INSERT
INTO
patient(
name,
surname,
middle_name
)
VALUES(
name,
surname,
middle_name
) ;
SELECT
LAST_INSERT_ID() AS patient_local_id;
END;
BEGIN
INSERT
INTO
demographics(
patient_id,
gender,
weight,
height,
ethnic_origin
)
VALUES(
patient_local_id,
patient_gender,
patient_weight,
patient_height,
patient_ethnic_origin
) ;
END;
END$$
DELIMITER ;
当我尝试从phpmyadmin
执行此存储过程时,出现以下错误:
Unrecognized keyword. (near "ON" at position 25)
SQL query: Edit Edit
SET FOREIGN_KEY_CHECKS = ON;
MySQL said: Documentation
#2014 - Commands out of sync; you can't run this command now