Generated SQL is wrapped with quotes, which doesn't work

I am generating SQL from my schema. The target database is Oracle, which requires the use of a “TO_DATE()” function to convert a string to a date, e.g.:

INSERT INTO "Car" ("Name", "SortOrder", "Created") VALUES ('Ford', 4, TO_DATE('2019-11-12', 'yyyy-mm-dd'))

I am using the “Date” data type for the column to generate the value, and using concat() to format:

concat("TO_DATE('", this, "', 'yyyy-mm-dd')")

In Preview, the SQL is generated correctly:

TO_DATE('2019-07-24', 'yyyy-mm-dd')

However, in the actual generated SQL, the TO_DATE() function is wrapped with quotes, which will not work:

'TO_DATE(''2019-11-13'', ''yyyy-mm-dd'')' (has the outer quotes)

My question:
Is there a way to get Mockaroo to create the correct SQL, without the outer quotes?


Did anyone resolve this issue? I’m facing the exact same situation.

EDIT: Ok, I found a way to do it using the “code” function:

code(“to_date(’#{this}’, ‘yyyy-mm-dd’)”)

2023 and I am facing the same issue too.
Tried above solution without result.

Anyone knows a trick ? :slightly_smiling_face: