Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2011

    Unanswered: Search for text in a blob field?

    We are using DB2 9.7 on a Windows platform and have a database which stores a number of binary files (mostly word documents) in a blob column. We have been asked by our client if it is possible to do a text search of said stored documents.
    I did not think this was possible in DB2 and was planning on using the java POI library to extract the docs and then search on the text I can extract, but I read that the Net Search Extender feature of DB2 might allow us to do this right in DB2.
    Does the Net Search Extender allow me to query a blob field directly?

    eg. Select * from myTable where blobField like '%searchString%'

    When I click on a database in control center, I do see a 'Net Search Extender' option in which I can select 'Enable Database For Text'.

    Sorry if this is a dumb question, I'm no DBA (and we have none), just a java developer trying to stumble through the client's requirements.

  2. #2
    Join Date
    May 2003
    It would hard to do a text search on a blob column since it holds binary data. You would have to search for the hex values, probably after you cast it as varchar for bit data (but not sure if the cast is still required in latest release).

    Word documents (docx) are now stored in compressed format, which makes things even more difficult.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Apr 2006
    Provided Answers: 11
    you have to install netsearch code and there is even a special package with drivers (will have to search the name) that is used with db2 CM that allows you to search in word documents. about the compress setting - this I can not confirm
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5-V11 Fundamentals- DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

  4. #4
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    Net Search Extender (and DB2 Text Search, which replaces it) work by indexing text fields, then you use certain functions (like CONTAINS) to search the text index and retrieve the original document. Normally only text-based types (like text, RTF, HTML, XML) are indexed. You can also index other document formats, but you'll need 3d party libraries for that, e.g.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts