Problem with INSERT function

insertsmallsql

I use this function INSERT (http://www.smallsql.de/doc/sql-functions/string/insert.html) to add a value in a data:

INSERT (log, POSITION(' edited' IN log), 1, 'NOW()')

I use also the NOW function to add the date in the data but it does not work. What is the problem?

Best Answer

When you write your INSERT query:

INSERT (log, POSITION(' edited' IN log), 1, 'NOW()')

In this way the DBMS thinks you try to put in your date field a string named "NOW()" instead of function to retrieve the current timestamp

You must remove the ' ' around NOW() function. In this way:

INSERT (log, POSITION(' edited' IN log), 1, NOW())