Search code examples
mysqlfunctionexecute

How to execute a MySQL function without showing the result


I have a UDF that can be called to proceed data like:

do proceed(123);

If I want to proceed data from a the database I run:

select proceed(id) from my_table;

but this shows the returns of the function

Is there a way to ignore the result with something like do process(id)?


Solution

  • If you just want to "execute" a UDF once per row, one way would be to use the SELECT ... INTO Syntax combined with any aggregate function like:

    select max(proceed(id)) into @nirvana from my_table