You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using SqlKata to generate non-parameterized Oracle insert statements by using ToString() on Compile() output.
This works well, but I want dates to be inserted with Oracle's TO_DATE function.
So I convert my .Net DateTime to a string, e.g. "TO_DATE('2019/03/19 09:03:47', 'yyyy/mm/dd hh24:mi:ss')". Because it's a string, SqlKata wraps it in single quotes, which doesn't work in Oracle.
Can we have a way to not wrap some strings in quotes?
The text was updated successfully, but these errors were encountered:
It's not supported now, if insert into select could be an option you can use the Insert(columns, query)overload.
varselect=new Query("AnyTable").SelectRaw("1 as Id, TODATE('2019/03/19 09:03:47') as Date");varquery= db.Query("TableToInsert").AsInsert(new[]{"name","date"},select);
Thanks Ahmad. Unfortunately the insert does not include a select.
ahmad-moussawi
changed the title
Ability to not wrap strings in single quotes on Oracle
Ability to pass raw string expressions in insert/delete statements
Aug 27, 2019
I'm using SqlKata to generate non-parameterized Oracle insert statements by using ToString() on Compile() output.
This works well, but I want dates to be inserted with Oracle's TO_DATE function.
So I convert my .Net DateTime to a string, e.g. "TO_DATE('2019/03/19 09:03:47', 'yyyy/mm/dd hh24:mi:ss')". Because it's a string, SqlKata wraps it in single quotes, which doesn't work in Oracle.
Can we have a way to not wrap some strings in quotes?
The text was updated successfully, but these errors were encountered: