MySQL function return more than 1 row

Posted by bobobobo on Stack Overflow See other posts from Stack Overflow or by bobobobo
Published on 2010-05-23T13:27:53Z Indexed on 2010/05/23 13:30 UTC
Read the original article Hit count: 197

Filed under:
|

I'd like to write a MySQL stored function that returns multiple rows of data. Is this possible? It seems to be locked at 1 row -- can't even return 0 rows.

For example

DELIMITER //

create function go()

RETURNS int
deterministic
NO SQL

BEGIN

return null ; -- this doesn't return 0 rows!  it returns 1 row
-- return 0 ;

END //

DELIMITER ;

Returning null from a MySQL stored proc though, doesn't return 0 rows.. it returns 1 row with the value null in it.

Can I return 0, or more than 1 row from a MySQL function, how?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about function