Oracle: eval function

The function takes some expression as the argument and executes it, returning output in the varchar string

create or replace function eval (expr varchar2) return varchar2
ret varchar2(4000);
execute immediate 'begin :result := ' || expr || '; end;' using out ret;
return ret;

The discussion and examples could be found there


One thought on “Oracle: eval function

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.