Oracle對CLOB欄位進行全文檢索索引

來源:互聯網
上載者:User

對CLOB欄位進行全文檢索索引可以用SELECT語句,但如果使用WHERE子句時必須使用dbms_lob.instr()函數,命令如下:

首先建立一個測試表TEST:
SQL>CREATE TABLE TEST3(A CLOB,B INT,C INT);
然後往表裡插入資料:
SQL> INSERT INTO TEST3 VALUES('TEST  測試 CLOB',11111,22222);

1 row created.

SQL> commit;

Commit complete.

對錶進行檢索:

SQL>  SELECT * FROM  TEST3 T WHERE dbms_lob.instr(T.A,'TEST',1,1)>0;

A                                                                                        B          C
-------------------------------------------------------------------------------- ---------- ----------
TEST  測試 CLOB                                                                      11111      22222

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.