简体   繁体   English

报告服务中出现ora-00939错误,SSRS

[英]ora-00939 error in reporting services, SSRS

I have an SSRS report, Oracle is my backend and am using this following query for dataset of my second parameter. 我有一个SSRS报告,Oracle是我的后端,并且正在使用以下查询查询第二个参数的数据集。

select distinct  X
from  v_stf_sec_user_staffing_center usc
where usc.center_group_id in  (
 select distinct center_group_id from  V_T_STAFFING_CENTER_GROUP scg
where  INSTR(','||REPLACE(:PI_REGION_LIST,' ')||',', ','||scg.group_abbreviation||',') > 0)
and usc.nt_user_name=:PI_NT_USER_NAME

Here PI_REGION_LIST is a multivalued parameter of string type. 这里PI_REGION_LIST是字符串类型的多值参数。 and PI_NT_USER_NAME is a default string valued parameter PI_NT_USER_NAME是默认的字符串值参数

This query works fine when I try to execute in manually in the Data tab, also in the Oracle tool. 当我尝试在“数据”选项卡以及Oracle工具中手动执行时,此查询工作正常。 But when I run the report in SSRS and select more than 3 values for the parameter PI_REGION_LIST the report throws an error on this dataset 但是,当我在SSRS中运行报表并为参数PI_REGION_LIST选择3个以上的值时,报表会在此数据集上引发错误

ora-00939 error,too many arguments for function. ora-00939错误,函数的参数太多。

I am not able to figure out the error here. 我无法在这里找出错误。

Please help me with an idea. 请帮我一个主意。

The REPLACE function takes three string parameters, the last being optional. REPLACE函数采用三个字符串参数,最后一个是可选的。

The MS documentation says a multi-valued parameter has the following restriction "The query must use an IN clause to specify the parameter." MS文档说,多值参数具有以下限制:“查询必须使用IN子句来指定参数。”

If you don't actually need to do the REPLACE to get rid of spaces, you should be able to do something like 如果您实际上不需要进行替换以除去空格,则应该可以执行以下操作

WHERE scg.group_abbreviation in (:PI_REGION_LIST)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM