来自远程表的LOB定位器

时间:2017-07-11 11:49:07

标签: oracle lob

在运行以下查询时从oracle中获取异常 ORA-22992:不能使用从远程表中选择的LOB定位器

        SELECT 
            OLU.CNIC,
            OLU.LR_USER_NAME NAME,
            OLU.FATHERS_NAME,
            OLU.ADDRESS,
            BATCH_VERIF.CREATED_DATE BATCH_DATE,
            TO_DATE(OLU.ATTRIBUTE9, 'mm/dd/yyyy hh:mi:ss AM')  TRANSLATION_DATE
    FROM ORION.ORN_LR_USER@LIV OLU
    INNER JOIN
    (
        SELECT MAX(BATCH_ID) BATCH_ID, CNIC
        FROM ORION.ORN_LR_BATCH_CNIC@LIV
        WHERE IMPORT_DATE IS NOT NULL AND IMPORTED = 'T'
        GROUP BY CNIC
    ) BATCH_CNIC
            ON (BATCH_CNIC.CNIC = OLU.CNIC
                    AND NVL (OLU.IS_BATCH_VERIFIED, 'F') = 'T' 
                    AND NVL (OLU.ATTRIBUTE10, 'F') = 'T'
                    AND OLU.ATTRIBUTE9 IS NOT NULL) 
        INNER JOIN ORION.ORN_FILE_BATCH_VERIF@LIV BATCH_VERIF
            ON BATCH_VERIF.BATCH_ID = BATCH_CNIC.BATCH_ID;

但在评论TRANSLATION_DATE之后它工作正常,也不是lob类型的列..这可能是什么原因?

        SELECT 
            OLU.CNIC,
            OLU.LR_USER_NAME NAME,
            OLU.FATHERS_NAME,
            OLU.ADDRESS,
            BATCH_VERIF.CREATED_DATE BATCH_DATE
            --TO_DATE(OLU.ATTRIBUTE9, 'mm/dd/yyyy hh:mi:ss AM')  TRANSLATION_DATE
    FROM ORION.ORN_LR_USER@LIV OLU
    INNER JOIN
    (
        SELECT MAX(BATCH_ID) BATCH_ID, CNIC
        FROM ORION.ORN_LR_BATCH_CNIC@LIV
        WHERE IMPORT_DATE IS NOT NULL AND IMPORTED = 'T'
        GROUP BY CNIC
    ) BATCH_CNIC
            ON (BATCH_CNIC.CNIC = OLU.CNIC
                    AND NVL (OLU.IS_BATCH_VERIFIED, 'F') = 'T' 
                    AND NVL (OLU.ATTRIBUTE10, 'F') = 'T'
                    AND OLU.ATTRIBUTE9 IS NOT NULL) 
        INNER JOIN ORION.ORN_FILE_BATCH_VERIF@LIV BATCH_VERIF
            ON BATCH_VERIF.BATCH_ID = BATCH_CNIC.BATCH_ID;

1 个答案:

答案 0 :(得分:0)

  

"当我将此列转换为日期类型"

时出现问题
嗯,听起来这可能是一个Oracle错误。但也许你可以用这个技巧解决它:

TO_DATE(substr(OLU.ATTRIBUTE9, 1, 22), 'mm/dd/yyyy hh:mi:ss AM') TRANSLATION_DATE