码迷,mamicode.com
首页 > 其他好文 > 详细

ORA-00932: inconsistent datatypes: expected - got NCLOB

时间:2021-01-28 11:38:55      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:测试   sub   nbsp   expec   instr   cli   sel   got   to_char   

    SELECT
        COUNT( * ) AS COUNT_APPROVAL
    FROM
        (
        SELECT
            SUBSTR(
                pqg.SUM_QUARTERLY_GOAL,
                INSTR( pqg.SUM_QUARTERLY_GOAL, ", - 1, 2 ) + 1,
                (
                    INSTR( pqg.SUM_QUARTERLY_GOAL, ", - 1, 1 ) - 2 - INSTR( pqg.SUM_QUARTERLY_GOAL, ", - 1, 2 ) + 1
                )
            ) AS APPROVAL
        FROM
            PROJECT_VIEW pv
            LEFT JOIN PROJECT_QUARTERLY_GOAL pqg ON pqg.PROJECT_CONTENT_ID = pv.PROJECT_CONTENT_ID
        )
    WHERE
        APPROVAL = 第五次新建测试20200107;

报错

> ORA-00932: inconsistent datatypes: expected - got NCLOB

 

由于APPROVAL的类型为NCLOB,所以需要不可以直接和类型varchar的值做比较,需要将APPROVAL类型转换为varchar

修改后sql:

 

    SELECT
        COUNT( * ) AS COUNT_APPROVAL
    FROM
        (
        SELECT
            SUBSTR(
                pqg.SUM_QUARTERLY_GOAL,
                INSTR( pqg.SUM_QUARTERLY_GOAL, ", - 1, 2 ) + 1,
                (
                    INSTR( pqg.SUM_QUARTERLY_GOAL, ", - 1, 1 ) - 2 - INSTR( pqg.SUM_QUARTERLY_GOAL, ", - 1, 2 ) + 1
                )
            ) AS APPROVAL
        FROM
            PROJECT_VIEW pv
            LEFT JOIN PROJECT_QUARTERLY_GOAL pqg ON pqg.PROJECT_CONTENT_ID = pv.PROJECT_CONTENT_ID
        )
    WHERE
    TO_CHAR( APPROVAL ) = 第五次新建测试20200107;

 

ORA-00932: inconsistent datatypes: expected - got NCLOB

标签:测试   sub   nbsp   expec   instr   cli   sel   got   to_char   

原文地址:https://www.cnblogs.com/seven-yin/p/14333288.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!