I have tried to create this function but the system is returning a \"LOOP error\" and I don\'t know how to return 3 variables at the same time. I\'ve tried hard to figure this o
To return multiple values at the same time, you'll want to specify OUT parameters and change the return type of the function to record. See the documentation here. Make sure to call the function with SELECT * to get the parameters back as 3 columns.
Please update your question to include the error you are getting, and if I can help I will update this answer to address it.