Bug #37087 mySQL functions can't return a Table
Submitted: 30 May 2008 5:25 Modified: 20 Nov 2013 11:04
Reporter: Jason Wisdom Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: FUNCTION, return table, udf

[30 May 2008 5:25] Jason Wisdom
Description:
From my reading and research, it seems that MySQL cannot call a UDF to return a Table.

Is there any way to get this implemented in a (near) future version?  This seems like a pretty important feature......

How to repeat:
Write a UDF

Create a temporary table

Return that temporary table
[14 Oct 2009 3:21] José Francisco RangelSerrano
Hi.

I don't understand.

1.- What is the syntax that sets to a variable a (Temporary) Table?
2.- What is Data Type of it? In function declaration: CREATE FUNCTION sp_name ([parameter[,...]])
    RETURNS type?????

Can you give me a example, please?

Thanks.

Thanks.
[20 Nov 2013 11:04] Sveta Smirnova
Thank you for the reasonable feature request.

In MySQL word, thought, this should be new kind of a plugin: say, user-defined procedure. Since MySQL functions return only single-row result sets.
[25 Sep 2016 10:51] Daniël van Eeden
This is related to or a duplicate of:
Bug #21534 	function returning a table