我有以下几点 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
1条答案
按热度按时间r6l8ljro1#
我找到了解决办法。在执行存储过程时,我选中了下面的框。