Inside my stored function I have :

formula := "(10+10 * 1000)/12";

(a simple math formula, with numbers only, dynamically created as a string)

How do I eval this, and return the result ?

I can't use EXECUTE (not possible inside a stored function) and if I make it a stored procedure and call it from a stored function, I get "Dynamic SQL is not allowed in stored function or trigger" -as if I would have the eval directly inside the function.

I need a stored function, and not a procedure, because I need to call it inside a SELECT statement.

解决方案

Apparently there is no solution to this.

I have applied a "paintfull" workaround in PHP, which I will not display here as it is not the subject of the question.

Logo

一站式 AI 云服务平台

更多推荐