Oracle Select NCLOB就像某些字符串一样(Oracle Select where NCLOB is Like some string)
我有一个Oracle表,在这个表中我有一个类型为NCLOB的列。 我想像这样执行SELECT LIKE :
SELECT * FROM T_WEB_TASK_IT WHERE DBMS_LOB.substr( T_WEB_TASK_IT.ISSUE_DESCRIPTION , 32000, 1) LIKE '%Turning on the%'但它没有用,我得到一个错误说:
字符串缓冲区太小
但是我不明白这是怎么回事,因为我知道这个特定记录的那一列中没有那么多字符!
任何帮助将不胜感激。
谢谢。
I have an Oracle table, and in this table I have a column of type NCLOB. I would like to perform a SELECT LIKE on it like so:
SELECT * FROM T_WEB_TASK_IT WHERE DBMS_LOB.substr( T_WEB_TASK_IT.ISSUE_DESCRIPTION , 32000, 1) LIKE '%Turning on the%'But it isn't working, I get an error saying:
String buffer too small
But I don't understand how can that be, cause I know for a fact that there aren't that many characters in that column for that particular record!
最满意答案
您可以使用DBMS_LOB.INSTR函数来搜索lob中的字符串。 喜欢这个:
SELECT * FROM T_WEB_TASK_IT WHERE DBMS_LOB.INSTR( T_WEB_TASK_IT.ISSUE_DESCRIPTION , 'Turning on the') > 0You can use DBMS_LOB.INSTR function to search for strings in the lob. Like this:
SELECT * FROM T_WEB_TASK_IT WHERE DBMS_LOB.INSTR( T_WEB_TASK_IT.ISSUE_DESCRIPTION , 'Turning on the') > 0更多推荐
发布评论