查询 Oracle Clob 数据类型 [英] Querying Oracle Clob datatype

查看:104
本文介绍了查询 Oracle Clob 数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在表中查询 clob 类型的列?我需要查询某个字符串的列的表(除了其他条件 - 我可能需要使用 Case 语句),我最初的想法是查询子查询中的数据,然后使用 Case 中的查找匹配顶部查询.但是我现在卡住了,因为我不确定如何在 Select 中查询 clob 类型数据!

how do I query a table for a column that is clob type? I need to query the table for the column for a certain string (in addition to other conditions - I might need to use Case statement), my initial idea was to query the data in the sub-query and then find a match using Case in the top query. however I am now stuck as I am not sure how to query clob type data in Select!

表中的 clob 列是一组段落,我尝试搜索的字符串可能位于段落中的任何位置.而且我不确定球的大小.

the clob column in the table is set of paragraphs, and the string I am trying to search for may be in any location in the paragraph. And I am unsure of the size of the clob.

推荐答案

希望这个例子能清楚地说明我想要解释的内容.

Hope this examples illustrates clearly what i am trying to explain.

SET SQLBL ON;
SET DEFINE OFF;

CREATE TABLE CLOB_TEST
(
clob_in CLOB
);

INSERT
INTO CLOB_TEST VALUES
  (
    'I am working as a DBA and senior database resource in L&T Infotech in Pune India'
  );


SELECT DBMS_LOB.SUBSTR(CLOB_IN,3000) ot FROM CLOB_TEST;

-----------------------------OUTPUT------------------------------------------

OT
I am working as a DBA and senior database resource in L&T Infotech in Pune India

-----------------------------OUTPUT------------------------------------------

这篇关于查询 Oracle Clob 数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆