gpt4 book ai didi

postgresql - "("位置 149 处或附近的 PSQLException 错误

转载 作者:行者123 更新时间:2023-11-29 12:32:50 33 4
gpt4 key购买 nike

你好,我正在尝试在 postgresql 数据库中上传文件,但出现错误:这是代码的堆栈跟踪。任何人都可以告诉我哪里出了问题吗?我的查询是-

String sql = "insert into project_details (document_type,file_type,file_upload,status,gid,userid,s_comment,s_date,s_time) values (?,?,?,?,?,?,?,current_date(),current_time());";   
org.postgresql.util.PSQLException: ERROR: syntax error at or near "("
Position: 149

最佳答案

当前日期和当前时间 don't have parentheses :

insert into project_details 
(document_type,file_type,file_upload,status,gid,userid,s_comment,s_date,s_time)
values
(?,?,?,?,?,?,?,current_date,current_time);

关于postgresql - "("位置 149 处或附近的 PSQLException 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36643726/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com