Space problem while access to DB


I need to send timestamp to database. Lets say
'UPDATE "myDB" SET "datetime" = 2019-06-20 10:00:10'

  1. If I use brackets , there it writes: org.codehaus.groovy.runtime.InvokerInvocationException: org.postgresql.util.PSQLException: ERROR: column “2019-06-20 10:00:00” does not exist

2)When I don’t: ERROR: syntax error at or near “10”
It probably stucks with space

The function itself works, checked it on other examples. It’s all about space…
Any ideas? Thanks in advance!


your sql string is wrong
def sql = “UPDATE myDB SET datetime = ‘2019-06-20 10:00:10’;”

try with this

1 Like

Thanks a lot!