Selecting multiple fields into multiple variables in a MySQL stored procedure
- by Stuart
I am a little new to store procedures in MySQL and was wondering if I can SELECT multiple columns into multiple variables within the same select query.
for example (iName is the input to the function):
DECLARE iId INT(20);
DECLARE dCreate DATETIME;
SELECT Id INTO iId, dateCreated INTO dCreate FROM products WHERE pName=iName;
Thanks