Can i call a mysql stored function from another mysql stored function or stored procedure, passing a string to the first function which is the name of the second function to call. I.e choosing the the second function via a value in field.
I suspect I can't and I will have to use a case statement, but I have to ask 🙂
Something like this?
CREATE FUNCTION `string_processing_chain` (function_name VARCHAR(1000),
data_to_process VARCHAR(1000))
RETURNS VARCHAR(1000)
BEGIN
RETURN ($function_name)(to_process);
END
Best Answer
I have never heard of something like this and I have never attempted before
Here is my best guess (using Dynamic SQL)
or
Give it a Try and tell us all if it worked, please !!!
From OP I used this :