我试图通过在选择查询中传递员工 ID 来提供所有员工详细信息。不幸的是,我无法获得员工 ID 的通过列表。
我在数组中有员工 ID 列表
employee_ids=[100,101,200,2003,400]
在 mule 中,我正在尝试使用流动查询获取所有员工详细信息
<db:select config-ref="mysql_Configuration" doc:name="get Employee details">
<db:sql>
select * from employee where employee_id in (:EMP_IDS)
</db:sql>
<db:input-parameters>
#[{'EMP_IDS' : vars.listEmployeeIds}]
</db:input-parameters>
</db:select>
它抛出一个错误:
********************************************************************************
Message : Invalid column type.
Error type : DB:QUERY_EXECUTION
我还尝试使用逗号分隔值传递所有员工 ID
哪里的价值
listEmployeeIds =[100,101,200,2003,400] joinBy ","
结果 = "100,101,200,2003,400"
<db:select config-ref="mysql_Configuration" doc:name="get Employee details">
<db:sql>
select * from employee where employee_id in (:EMP_IDS)
</db:sql>
<db:input-parameters>
#[{'EMP_IDS' : vars.listEmployeeIds}]
</db:input-parameters>
</db:select>
但它也给了我错误,因为它间接地转换为字符串,所以它给了我:
Message : java.sql.SQLSyntaxErrorException: invalid number
.
Error type : DB:BAD_SQL_SYNTAX
谁能帮我解决这个问题?