将逗号分隔的字符串传递给SSRS

时间:2015-01-07 09:25:01

标签: database oracle reporting-services report

我在SSRS的前端传递了逗号分隔的字符串。我的查询如何在后端识别它而不将整个字符串视为单个?

例如:我输入" Harry,Potter,Book "在SSRS的输入字段中,我希望每个字符串分开并传递给后端查询。

Select * from tbl_test where name in ('harry', 'potter','book')

1 个答案:

答案 0 :(得分:0)

我希望前端传递PLSQL Block中的输入,如下所示

PROCEDURE p1(inparam varchar2)
IS 
  v_inparam varchar2(100);

BEGIN

v_inparam := inparam;

Select * into <object> from tbl_test where name in
  (select trim(regexp_substr(v_inparam ,'[^,]+', 1, level)) from dual
    connect by regexp_substr(v_inparam , '[^,]+', 1, level) is not null);
END;