I have a situation where the user enters some validation input in SQL format. This SQL query is just using basic sql date functions but not using any databse column. Sample query:
Select UNIX_TIMESTAMP(NOW()) < UNIX_TIMESTAMP(CASE WHEN DAYOFMONTH(NOW()) <= 10
THEN add_MONTHS(DATE_ADD(NOW(), (-1*DAYOFMONTH(NOW()))+1),-1)
ELSE DATE_ADD(NOW(), (-1*DAYOFMONTH(NOW()))+1) END)
I am able to run this when i have a connection object configured to some real database. But i do not find it worth to use a database and manage it just for this purpose. Is there a way where i can execute these type of queries or queries like select date() from dual etc in my code.