开发者

Oracle Error: inconsistent datatypes

开发者 https://www.devze.com 2023-02-11 06:37 出处:网络
I am using the following query in my ORACLE(10g) DB. SELECT * from student_table where student_no like \'%STUDENT%\'

I am using the following query in my ORACLE(10g) DB.

SELECT * from student_table where student_no like '%STUDENT%' INTERSECT SELECT * from student_table where student_no in ('STUDENT1234','STUDENT5678')

I got error like: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got CLOB

Any Idea how to resolve this Error开发者_StackOverflow中文版?


I guess student_table contains at least one column with datatype clob.

You shoul not select * then, but only the non-clob columns.


You can't do an INTERSECT when the result set includes any LOB.

In this case, however, you don't need the intersect anyway:

SELECT * from student_table
where student_no like '%STUDENT%'
and student_no in ('STUDENT1234','STUDENT5678');

And, as pointed out earlier, the first condition is redundant anyway in this particular instance:

SELECT * from student_table where student_no in ('STUDENT1234','STUDENT5678');
0

精彩评论

暂无评论...
验证码 换一张
取 消