ORA-00911:无效字符(适用于.NET的Oracle数据提供程序,托管驱动程序)

时间:2017-11-08 13:59:29

标签: sql oracle reporting-services

我在SSRS中执行此oracle时遇到此问题

查询是:

SELECT something
FROM   x
WHERE  productid <> 'Cash'
       AND va.principal IN (WITH t
                                 AS (SELECT ? STR
                                     FROM   dual)
                            SELECT REGEXP_SUBSTR (str, '[^,]+', 1, LEVEL)
                                   SPLIT_VALUES
                             FROM   t
                             CONNECT BY LEVEL <= (SELECT LENGTH (
                                                 Replace (str, ',',
                                                 NULL))
                                                  FROM   t))
ORDER  BY cusip,
          portfolio  

1 个答案:

答案 0 :(得分:0)

重写您的查询,看起来像这样。

SELECT something
FROM   x va
       JOIN (WITH t
                  AS (SELECT ? STR
                      FROM   dual)
             SELECT REGEXP_SUBSTR (str, '[^,]+', 1, LEVEL) split_values
              FROM   t
              CONNECT BY LEVEL <= (SELECT Length (REPLACE (str, ',', NULL))
                                   FROM   t)) b
         ON va.principal = b.split_values
WHERE  productid <> 'Cash'
ORDER  BY cusip,
          portfolio;