I created a stored procedure with the output parameter @name. But when I call it, I receive Null. How do I correctly call the procedure or is there an error in the procedure?
CREATE PROCEDURE GetName(IN kartennummer CHAR(16), OUT name VARCHAR(91))
BEGIN
SELECT @name = (SELECT CONCAT_WS(' ', Vorname, Nachname) FROM Kunden kund JOIN Konten kont WHERE kund.KundenID = kont.KundenID AND kont.Kartennummer = kartennummer);
END;
I call the procedure like this:
CALL GetNAME("7717015800401117", @name);
Why do I receive Null and not the name? The Select statement alone works.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…