I'm trying to create a stored procedure
in phpmyadmin
.
My definition is:
BEGIN
INSERT INTO `medication_mapping` (`patient_id`, `active_ingredient_id`, `strength`, `pharmaceutical_dose_form_id`, `number_of_units_per_intake`, `frequency_of_intake`, `date_of_onset`, `duration`, `unit_id`, `status`, `version_id`) VALUES (p_id, a_i_id, str, dose_id, n_u, freq, onset_dt, duration, unit_id, stat, v_id);
END
When I'm trying to save it I get the following message:
One or more errors have occurred while processing your request:
The following query has failed: "CREATE DEFINER=`cefcy`@`localhost` PROCEDURE `insert_medication_mapping`(IN `p_id` INT(11), ) NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER BEGIN INSERT INTO `medication_mapping` (`patient_id`, `active_ingredient_id`, `strength`, `pharmaceutical_dose_form_id`, `number_of_units_per_intake`, `frequency_of_intake`, `date_of_onset`, `duration`, `unit_id`, `status`, `version_id`) VALUES (p_id, a_i_id, str, dose_id, n_u, freq, onset_dt, duration, unit_id, stat, v_id); END"
MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER BEGIN INSERT INTO `medication_m' at line 1
This is my medication_mapping
table: