View Single Post

  #1 (permalink)  
Old 10-24-2005
Laurenz Albe
 
Posts: n/a
Default query for function/procedure metadata

I have been asked to compose a query to return the metadata of a
function or procedure (MySQL 5.0): argument names and types, IN or OUT,
return value if appropriate.

The ultimate goal is to provide these metadata to an application that
accesses the database via .NET; the developer claims that there is no
way to retrieve these data via the .NET driver and asked me for a
workaround.

Selecting INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION returns only
the function body.

I had the idea to write a function that issues a SHOW CREATE FUNCTION
and parses the result, but I am facing problems with this approach:

- There is nothing like a 'SHOW ... INTO <variable>'

- I considered declaring a cursor for the statement and retrieve the
SHOW result this way.
However, I found no way to declare a cursor for a dynamic statement.

Can anybody think of a way to achieve my goal?

Thank you,
Laurenz Albe
Reply With Quote