Oracle Select NCLOB就像某些字符串一样(Oracle Select where NCLOB is Like some string)

系统教程 行业动态 更新时间:2024-06-14 17:02:17
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') > 0

You 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

更多推荐

本文发布于:2023-04-21 18:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/34e792c7f0575494e94446c2b4f6db5a.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:就像   字符串   Select   Oracle   string

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!