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?
Thanks.