【发布时间】:2019-10-16 05:33:32
【问题描述】:
我无法将 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
我想在mmm、ccc、eee 中发送 3 个数组。当我在 Postgres 控制台上尝试时,它工作正常,但是当我在 Java 代码中尝试时,抛出异常
org.postgresql.util.PSQLException: ERROR: cannot cast type record to integer
Position: 474
【问题讨论】:
标签: java postgresql jdbc jdbctemplate