postgresql - Jasper 报告:通过集合参数执行 SQL 语句时出错
问题描述
我正在创建一个通过集合参数传递的报告。参数名称为“ids”,类为 java.util.Collection。
我的查询:
select * from order_deliveryorder a
left join order_deliveryorderline b on a.id = b.d_order_id
left join order_item c on c.id = b.product_id
left join order_orderline e on e.id = b.s_order_id
left join order_order f on e.order_id = f.id
left join order_itemsection g on g.id = f.section_id
left join order_location d on d.id = a.location_id
left join order_location h on h.id = a.from_location_id
where a.id in ('2377900603251741014','2377900603251740997','2377900603251740967')
jasper 中的查询:
select * from order_deliveryorder a
left join order_deliveryorderline b on a.id = b.d_order_id
left join order_item c on c.id = b.product_id
left join order_orderline e on e.id = b.s_order_id
left join order_order f on e.order_id = f.id
left join order_itemsection g on g.id = f.section_id
left join order_location d on d.id = a.location_id
left join order_location h on h.id = a.from_location_id
where $X{IN, a.id, ids}
参数“ids”的值为 ["2377900603251741014","2377900603251740997","2377900603251740967"]
最后,遇到了执行sql语句的错误。
解决方案
推荐阅读
- python - JupyterLab:如何使用键盘快捷键清除当前单元格的输出?
- visual-studio-code - 使用 VS Code 时如何解决 Rust 中的“未解析导入”?
- java - 从文件中替换字符串中的确切字符?
- mysql - Mysql查询执行速度慢
- corda - 如何获得 Corda 交易时间?
- php - stripe-laravel 不连接
- php - 如何在没有登录的情况下将数据插入数据库,wordpress?
- python - 在 Flask、SqlAlchemy、Python 中创建一个自动知道是插入还是更新的函数
- ajax - Scrapy - 使用 ajax 进行分页
- java - 配置 mobileFirst 密钥库后仍然遇到证书错误