0

can I create a udf that sums variables that change in length each time? So one instance I have select sum_func(A, B, C), sum_func(A, B) from table or do the amount of variables per UDF need to be specific like 3 for example? Or do I just need to declare a new variable each time with my values?

pdangelo4
  • 220
  • 4
  • 17
  • Are you talking about a UDF written in C, or a stored function written in MySQL? – Barmar Aug 09 '21 at 18:42
  • *sum_func(A, B, C), sum_func(A, B)* - impossible. MySQL always checks the amount and the datatypes of parameters. But possible - sum_func('A,B,C'), sum_func('A,B') – Akina Aug 09 '21 at 18:43

0 Answers0