mysql “not a variable or NEW pseudo-variable” message

佐手、 提交于 2019-12-18 19:43:19

问题


I'm trying to create a procedure that will enter data and then return a message in the OUT parameter, however i'm getting this message "argument 5 for routine hospital.alextest10 is not a variable or NEW pseudo-variable in BEFORE trigger"

i have this as my procedure:

create procedure alextest10
(IN a_patid CHAR(3), IN a_patnam VARCHAR(12), IN a_consno CHAR(3), IN a_ward CHAR(2),
OUT a_message VARCHAR(50))
BEGIN
set a_message = 'Database updated';
INSERT INTO patient (patient_id, patient_name, consultant_no, ward_no)
values (a_patid, a_patnam, a_consno, a_ward);
end!

and this as my call command:

call alextest10 ('p99', 'Madeuppy', '999', 'w9', a_message)!

Can you help?

Much appreciated!


回答1:


CALL alextest10 ('p99', 'Madeuppy', '999', 'w9', @a_message);
SELECT @a_message;


来源:https://stackoverflow.com/questions/9751707/mysql-not-a-variable-or-new-pseudo-variable-message

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!