I've problem with binding current date. I want to use datetime('now')
function as one of inserted value.
I've used something like this:
sqlite3_bind_text(stmt, i + 1, values[i], -1, SQLITE_STATIC);
where values[i]
is char * text = datetime('now')
. But obviously it inserts that text. Is there possibility to bind function like that: datetime('now')
?
Binding, by definition, nicely escapes everything and makes sure everything is a string that the SQL interpreter doesn't actually misread as an SQL component. It's a data safety issue.
Instead, make your
stmt
variable put the datetime('now') directly where it should be in the original SQL expression. IE, remove the related?
and putdatetime('now')
in its place.