标签:测试 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