SSAS多维数据集进程:OLE DB错误:OLE DB或ODBC错误:ORA-00936:缺少表达式

时间:2016-09-01 13:12:48

标签: sql-server ssas

我是SSAS的新手,在处理多维数据集时遇到了下面提到的问题。   我正在使用MS Visual Studio 2015 Shell(集成)。我从Oracle 12C获取数据并使用“Oracle Provider for OLE DB”作为提供程序。   问题:    在数据源视图(DSV)中,我创建了一个命名查询,我在多维数据集中将其用作度量组表。    当我从DSV中的命名查询中探索数据时,它正确地返回数据    但是,当我将它用作立方体中的度量表并尝试处理多维数据集时,它会抛出错误,如

  

OLE DB错误:OLE DB或ODBC错误:ORA-00936:缺少表达式

我认为它与查询语法无关,因为,否则当我在DSV中运行命名查询时会抛出错误。但是,事实并非如此。    处理多维数据集时只会抛出错误。

任何帮助都将不胜感激。

命名查询:

 SELECT    NVL (D.PRODUDC_ID, 'NA') AS BRAND_ID, 
                   DECODE (G.REGION_CODE,
                           'EAS', 'EAST',
                           'WES', 'WEST',
                           'NOR', 'NORTH',
                           'SOU', 'SOUTH',
                           'No Region') AS REGION,

                    ---- G.REGION_CODE AS REGN_ID,
                    NVL (I.CHANNEL_ID, 'NA') AS CHANNEL_ID,
                    TO_NUMBER(T.QUARTER_NO||T.WEEK_NO||T.YEAR_NO) AS QWY,
                    TO_NUMBER(TO_CHAR(T.YEAR_NO)) AS YEAR_ID,
                    DECODE (
                         (  SUM (
                               CASE
                                  WHEN B.INVD_PROD_STK_TYPE_ID = '7'
                                  THEN
                                     CASE
                                        WHEN A.INVH_TYPE IN
                                                ('D', 'R', 'N', 'G', 'F')
                                        THEN
                                           B.INVD_TOT_INV_QTY
                                        ELSE
                                           0
                                     END
                                  ELSE
                                     CASE
                                        WHEN A.INVH_TYPE IN
                                                ('D', 'R', 'N', 'G', 'F')
                                        THEN
                                           B.INVD_TOT_INV_QTY * C.NET_VOL
                                        ELSE
                                           0
                                     END
                               END)
                          ,
                       NULL, 0,
                        SUM (
                               CASE
                                  WHEN B.INVD_PROD_STK_TYPE_ID = '7'
                                  THEN
                                     CASE
                                        WHEN A.INVH_TYPE IN ('C', 'T', 'X')
                                        THEN
                                           B.INVD_TOT_INV_QTY
                                        ELSE
                                           0
                                     END
                                  ELSE
                                     CASE
                                        WHEN A.INVH_TYPE IN ('C', 'T', 'X')
                                        THEN
                                           B.INVD_TOT_INV_QTY * C.NET_VOL
                                        ELSE
                                           0
                                     END
                               END))
                       / 1000)
                       AS SALES_CY
               FROM T_HDR_TRANS A,
                    T_DETL_TRANS B,
                    T_PROd_MAST C,
                    T_PROD_CLASSIFICATION D,
                    T_CUST_MAST E,
                    T_V_ST_GEOGRAPHY G,
                    T_SEGMENT_UDC H,
                    T_SEG_CHNL_MAP I,
                    T_TIME T
              WHERE     A.INVH_ID = B.INVH_ID
                    AND B.PROD_ID = C.PROD_ID
                    AND C.CLASSIFICATION_ID1 = D.PRODUDC_ID(+)
                    AND A.CUST_ID = E.CUST_ID
                    AND H.SEG_CODE = I.SUBSEGMENT_DETAIL_ID(+)
                    --AND I.CHANNEL_ID = CN.CHNL_ID

                    --AND I.CHANNEL_ID <> 'HD'
                     AND A.COMP_ID <> 'DIRECT'
                    AND T.WEEK_ID >= (SELECT MIN ( (YEAR_ID || LPAD (WEEK_ID, 2, 0)))
                                              FROM T_WEEKLY_SALES
                                              WHERE YEAR_ID = (SELECT TO_CHAR (SYSDATE, 'YYYY') FROM DUAL))
                   AND T.WEEK_ID <= (SELECT DISTINCT
                                            CASE 
                                            WHEN TO_CHAR (WEEK_ID)  = '201601'
                                            THEN '201553'
                                            ELSE TO_CHAR (WEEK_ID)
                                            END AS CURRENT_WEEK 
                                            FROM T_TIME
                                            WHERE time_id = TO_NUMBER (TO_CHAR (SYSDATE, 'yyyymmdd')))
        AND (D.PRODUDC_ID IS NOT NULL  AND D.PRODUDC_ID <> 'NA')
           GROUP BY D.PRODUDC_ID,
                    G.REGION_CODE,
                    I.CHANNEL_ID,      
                   TO_NUMBER(T.QUARTER_NO||T.WEEK_NO||T.YEAR_NO),
                    T.YEAR_NO

0 个答案:

没有答案