1

Tengo la siguiente consulta y quisiera saber de que manera es posible agregarla a un Source Qualifier en Informatica Power Center:

SELECT TO_NUMBER(a.fcnctroctosuc) AS FNCC, a.fcnombre AS nombreCC,
REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 1)    AS NIVEL_1
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 2)    AS NIVEL_2
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 3)    AS NIVEL_3
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 4)    AS NIVEL_4
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 5)    AS NIVEL_5
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 6)    AS NIVEL_6
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 7)    AS NIVEL_7
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 8)    AS NIVEL_8
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 9)    AS NIVEL_9
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 10)    AS NIVEL_10
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 11)    AS NIVEL_11
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 12)    AS NIVEL_12
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 13)    AS NIVEL_13
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 14)    AS NIVEL_14
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 15)    AS NIVEL_15
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 16)    AS NIVEL_16
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 17)    AS NIVEL_17
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 18)    AS NIVEL_18
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 19)    AS NIVEL_19
                        ,       REGEXP_SUBSTR (SYS_CONNECT_BY_PATH(a.fcnctroctosuc, '/'), '[^/]+', 1, 20)    AS NIVEL_20
                        , NULL ESTATUSCC
                        , A.FISTATUS STATUS
                        , 'MMONTOYAB' USUARIO_CREA
                        , SYSDATE FECHA_CREA
                        , 'MMONTOYAB' USUARIO_MODIFICA
                        , SYSDATE FECHA_MODIFICA
                        ,a.fiidpais IDPAIS
FROM Indicadores.Ceco_primarios A LEFT OUTER JOIN INDICADORES.ceco_estructura C ON A.FCNCTROCTOSUC=c.ficcid_hijo
WHERE TO_NUMBER(to_char(A.FDFECHAPROCESO,'YYYYMMDD')) = (SELECT TO_NUMBER(to_char(MAX(FDFECHAPROCESO),'YYYYMMDD')) FROM INDICADORES.CECO_PRIMARIOS where FIIDENTIDAD not IN(13,53))
AND FIIDENTIDAD not IN(13,53)
AND A.FCNCTROCTOSUC >= 0
--AND A.FISTATUS = 1 
AND TO_NUMBER(TO_CHAR(c.fdfechaproceso, 'YYYYMMDD')) = (SELECT TO_NUMBER(TO_CHAR(MAX(FDFECHAPROCESO),'YYYYMMDD')) FROM indicadores.ceco_ESTRUCTURA WHERE FITIPOESTRUC = 1 AND FIESTRUCTURA = 8)
AND C.FITIPOESTRUC = 1 AND FIESTRUCTURA = 8
START WITH a.fcnctroctosuc = 102
CONNECT BY NOCYCLE PRIOR a.fcnctroctosuc = c.ficcid_padre
1
  • Crea un SQ con la lista de campos en el SELECT, en el mismo orden y tipo de dato. Luego agrega la consulta en la propiedad SQL Query del Source Qualifier.
    – monroe
    Commented el 13 jun. 2019 a las 22:02

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.