java - Postgresql timestamp update set null -
i have problem timestamp field in postgresql database
scheduled_time timestamp without time zone,
and posibility set null on update. still
error: column "scheduled_time" of type timestamp without time zone expression of type bytea wskazówka: need rewrite or cast expression.
i tried set null, tried set empty string "" tried find solutions @ internet, know work when set @ pgadmin null, when set parameter in
querystring = "update upload set additional_info=:additionalinfo, customer_id=:customerid, scheduled_time=:scheduledtime upload_id=:uploadid"; final query query = entitymanager.createnativequery(querystring); query.setparameter("scheduledtime", upload.getscheduledtime()); more setparameters .... query.executeupdate();
its still me message type bytea. can tell me how solve that?
i checking if scheduled null. when true, make
update upload set additional_info=:additionalinfo, customer_id=:customerid, scheduled_time= null upload_id=:uploadid
else
update upload set additional_info=:additionalinfo, customer_id=:customerid, scheduled_time=:scheduledtime upload_id=:uploadid
couse didn't find normal solution.
Comments
Post a Comment