语句中加入参数,执行就报错

image.png

FineReport yzmzx5HM9312217 发布于 2023-7-26 18:02
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
runnerLv7资深互助
发布于2023-7-26 18:04(编辑于 2023-7-26 18:10)

往出粘贴一下sql

image.png

参数加个引号看一下

='${month}'

  • yzmzx5HM9312217 yzmzx5HM9312217(提问者) select HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.bill_year || \'-\' || HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.bill_month, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.plan_type, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.version, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.factory, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.matcode, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.matname, sum(nvl(qty, 0)) from HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH left join HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC on HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.id = HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.mainid where HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.bill_year || \'-\' || HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.bill_month =${month} and HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.plan_type = ${plan_type} and HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.version =${version} group by HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.bill_year || \'-\' || HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.bill_month, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.plan_type, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTH.version, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.factory, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.matcode, HBPRODUCTIONCOMMAND.PLA_WORKPLAN_MONTHGC.matname
    2023-07-26 18:05 
  • 2关注人数
  • 145浏览人数
  • 最后回答于:2023-7-26 18:10
    请选择关闭问题的原因
    确定 取消
    返回顶部