Where is the syntax error in this MySQL stored procedure?

邮差的信 提交于 2020-05-17 08:49:19

问题


I want to set the output parameter name to the concatenated kund.Vorname and kund.Nachname. But I get a syntax error and I can't find it. I'd appreciate any help.

CREATE PROCEDURE GetName(IN kartennummer CHAR(16), OUT name VARCHAR(91))
BEGIN
SELECT @name = (CONCAT_WS(' ', kund.Vorname, kund.Nachname) FROM Kunden kund, Konten kont WHERE kund.KundenID = kont.KundenID AND kont.Kartennummer = kartennummer));
END;

回答1:


You are closing too many brackets on line 3




回答2:


First you're using name without a leading @ and in the Select Statement @name. That's not the same.



来源:https://stackoverflow.com/questions/61680826/where-is-the-syntax-error-in-this-mysql-stored-procedure

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