irpas技术客

nested exception is org.postgresql.util.PSQLException: ERROR: function to_char(u

irpas 5707

postgresql数据库,执行时候报错。

nested exception is org.postgresql.util.PSQLException: ERROR: function to_char(unknown, unknown) is not unique ? 建议:Could not choose a best candidate function. You might need to add explicit type casts.

原sql语句

select ?? ?to_char(flight_date, 'yyyy-mm-dd') as flight_date, ?? ?fdmrecid, ?? ?airlineid, ?? ?flightno, ?? ?main_sta, ?? ?voyage from ?? ?cfps_flt_fdm where ?? ?to_char(flight_date, 'yyyy-mm-dd')= to_char(#{parameter,jdbcType=TIMESTAMP}, 'yyyy-mm-dd') ?? ?and delflag = 'N'

问题出现的原因,

to_char函数可以用在字段上,但是不可以用在入参中。此处为#{parameter}。

修改后,错误消失。


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #NESTED #exception #is #error #function #to_charu