Bug #28765 MySQL Error Number 1415
Submitted: 30 May 2007 8:10 Modified: 30 May 2007 8:18
Reporter: Balachandra S Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.0.37-community-nt OS:Windows
Assigned to: CPU Architecture:Any

[30 May 2007 8:10] Balachandra S
Description:
Hi,

I am creating a function which concats the employees.

This function retruns a result set.

But i get the error which i try to create the function

"MySQL Error Number 1415
Not allowed to return a result set from a function"

Please let me know how to fix this bug

thanks

Balachandra.S

How to repeat:
REATE FUNCTION fn_MeetingMembers(pmmSlNo Int) RETURNS VARCHAR(1000)
BEGIN

	DECLARE pMemberNames VARCHAR(100);

	SET pMemberNames = '|';

	SELECT pMemberNames = concat(pMemberNames,'',epName)
	FROM MEETINGMEMBER m,EMPLOYEES e
	WHERE m.mmSlNo = pmmSlNo AND m.epSlNo = e.epSlNo;

	SET pMemberNames = REPLACE(pMemberNames, '|,', '');

	RETURN pMemberNames;

END
[30 May 2007 8:18] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read carefully about CREATE FUNCTION syntax at http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html