Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am converting sql server data base to mysql. I had transfered all tables but i have problem creating functions and i dont know how to create table valued functions in mysql.
can anybody help me to create it.
Posted
Updated 6-Jul-15 19:51pm
v2
Comments
Michael_Davies 7-Jul-15 5:09am    
Lots of people asking this question when I Google it. It is not possible in MySQL, see documentation on function return types.

http://dev.mysql.com/doc/refman/5.7/en/create-function-udf.html

Suggestion; use a procedure and pass a name to create a temporary view or table, use that after the call and delete it when finished (it will auto delete when you close the connection), this means you can not use it as a return value directly.

Alternative depending on your use is a nested SELECT.
jagdish123061 7-Jul-15 7:21am    
Thank u for reply.

I also know that it is not possible but is there any other way to achive it.
Michael_Davies 7-Jul-15 12:55pm    
As per my suggestion, it really depend on what the function tries to achieve if it is a straight select use a nested select.

Show the function as an example and maybe people can help you more.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900