B4J Question Timestamp in INSERT error

Wojtekbut

New Member
I have timestamp column in my postgres db.
When I want insert record, there is an error: "PSQLException: ERROR: syntax error at or near $2"
This is my sql: INSERT INTO table (name, "date") VALUES (?, TIMESTAMP ?)
Column type: name - varchar, date - timestamp
 
Solution
I've got a solution.
It seems that TIMESTAMP accept only literals.
It should be: INSERT INTO table (name, "date") VALUES (?, ?::timestamp)
or timestamptz - with time zone

Wojtekbut

New Member
I've got a solution.
It seems that TIMESTAMP accept only literals.
It should be: INSERT INTO table (name, "date") VALUES (?, ?::timestamp)
or timestamptz - with time zone
 
Upvote 0
Solution
Top