在JDBC中发送带有unnest(array [someArray])的三个数组的异常]] << [

问题描述 投票:0回答:1
我无法将3个数组发送到SQL语句中,它会引发异常

select t.ttt, t.created_date, concat_ws('-',lp.mmm, lp.ccc, lp.eee ) from tasks t join positions p on t.id = p.task_id left join lte_position lp on p.id = lp.id where t.ttt in (:identities) and (lp.mmm, lp.ccc, lp.eee) in ((select mmm,ccc,eee from ((select unnest(array[:mmm]) as mmm, unnest(array[:ccc]) as ccc, unnest(array[:eee]) as eee)) as temp)) order by t.ttt DESC

我想在mmmccceee中发送3个数组。当我在Postgres控制台上尝试正常运行时,但是当我在Java代码中尝试运行时,会引发异常

org.postgresql.util.PSQLException: ERROR: cannot cast type record to integer Position: 474

我无法将3个数组发送到SQL语句中,它会从任务t的连接位置选择t.ttt,t.created_date,concat_ws('-',lp.mmm,lp.ccc,lp.eee)引发异常p on t.id = p.task_id左连接...
java postgresql jdbc
1个回答
0
投票
您编写它的方式,PostgreSQL认为您的整个参数字符串都是单个整数。
© www.soinside.com 2019 - 2024. All rights reserved.