Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

search in long datatype column

436410Mar 7 2005 — edited Mar 8 2005
Hi,

as the subject suggests, I have a long datatype column in my table, and I wanna do a search in this column, I used this select statement and I get an error:

SELECT * FROM MYTABLE WHERE UPPER(MY_LONG_COLUMN) LIKE UPPER('%my_search_word%');

and this is the error I get:

ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got LONG

So I read a bit on the internet and found that I could do the search in the first 2000 characters of my column by converting it to a varchar2 by using substr, but I get the same error (ORA-00932) with the following statement:

SELECT * FROM MYTABLE WHERE UPPER(SUBSTR(MY_LONG_COLUMN, 1, 2000)) LIKE UPPER('%my_search_word%');

Any suggestions??

Thanks,

Mike
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2005
Added on Mar 7 2005
17 comments
9,965 views