How do I search a word document stored in a BLOB using PHP?

I have been successful at saving files in a blob field using oracle.
I need to search through the word document, how can I do it using PHP?
Please help!

You're going to want to look at the Text Application Developer's guide.
9i - http://otn.oracle.com/pls/db92/db92.show_toc?partno=a96517&remark=drilldown&word=microsoft+word
10g -
http://otn.oracle.com/pls/db10g/db10g.show_toc?partno=b10729&remark=drilldown&word=text+application+developer%27s+guide
Give this a read and it'll give you what you need in order to search CLOB and BLOB fields for text data.
It all works around a particular type of index which is then referenced using a CONTAINS clause in your SQL... eg:
SELECT id FROM documents WHERE CONTAINS( document_body, 'Oracle' ) > 0
Once you've got your head around the basic priniciples you're going to want to look at the document filters. This should allow you to index MS Word documents (warning: I've never used this for Word).
It's not something that you can just pick up from reading a 20 line reply on a forum, but it sounds like what you're looking for.
We use it here in order to look up on HTML documents, and it works a treat. We converted our Word documents to HTML so we could mark them up and then display them inline on pages.
We wrap up the SQL that actually does the CONTAINS clause in a PL-SQL function, but I don't image there's a problem issuing a CONTAINS over OCI. Let me know if it works!
Might this be an option for you?
Blog at http://robertbaillie.blogspot.com

Similar Messages

  • How to show a word document stored in a BLOB column?

    Hi guys.
    I'm trying to show the content of a MS Word document through forms 6i. This document was stored as byte-for-byte by an application developed in .Net to an BLOB column (oracle table). Anybody could help me in how to show this document using Internal Persistend LOBs and through forms 6i?
    I've been searching for it a lot of time without success...
    Thank you in advance.
    Alex.

    I've read about using the ole2 item, but I don't how to do it with BLOB files. I tried to use it and didn't work... I don't know if I've used it correctly or not. Could anybody give a sample, please?
    If anybody knows other way to do it, please send too.
    Thanh you,
    Alex.

  • How to save and work with a Word document stored in the Oracle 8i Database?

    Hi,
    If you have any experience with saving and working with a Word document (stored in 8i) from Forms 6.0, then please let me know how.
    Thanks ...
    Peter Nielsen

    hi
    i had worked storing word documents in oracle8i.tell me what exactly u want to know.
    null

  • Modifying MS WORD documents stored in BLOBS. (Oracle 9i Release 9.2.0.4.0)

    I have a need to replace a string of characters in an MS Word document that is stored in a BLOB field in an Oracle 9i database.
    Background: We have a large number of MS Word documents (~50,000) and many of them contain links to other Word documents stored on various servers throughout our network. We are moving a number of these servers, thus invalidating these links. I need to be able to update these links without having to open up every one of these documents and doing it manually.
    Is it possible, using PL/SQL, to update these links in these MS Word documents that are stored in Oracle? I have currently written a quick PL/SQL routine that will find the links and provide their location within the document, but I am not sure how I can update them. The problem, as I see it, is that if the characters that I am replacing differ in length than those that are currently in the existing document, then I would have to shift the remaining bytes of the document either left or right to preserve the integrity of the document.
    Is this possible, or should I pursue another option?

    It does not have to manual, but I think you will need to use word to modify and save the documents.
    The most automated process I can think of would be to write a client program to fetch a blob, run word, and have a word macro or add in to make the edits save, and then the client program updates with the new blob.
    With that number of documents, I would probably try to fetch a bunch of blobs and have word process them all before updating them for performance reasons.
    Unfortunately I would have no clue how to do the word automation, but I wouldn't touch those blobs using pl/sql

  • Printing Word Document stored in BLOB from Reports

    I have stored images and MS-Word documents in the DB in a BLOB column. Using reports 6, I am able to print the images by setting the File Format property of the item to Image. What I need to know is how can I print the Word document that has been stored in the DB using reports? Any alternative suggestions welcome...
    Thanks for your help.
    Aparna

    Hi Aparna,
    I have tried the same with CLOB instead BLOB.
    (MS Word)
    Only problem is (as expected) any graphics (BOLD, Table etc) will not work when printing. It also replaces the TABS with A single space.
    If you have found an answer, please let me know.
    Tissa
    ([email protected])
    null

  • How do i retrieve the word document format

    I write a java program which writes a word document in to a BLOB in oracle database. and i retrieve the word document from the database and flush the output to a word document in local path. i do get the output and the word document is saved to my local path, but when i try to open the document it opens ina junk format which cannot be read.. how to preserve the format of the document??
    here is the sample code..
    I open a connection.......
    File fileIn     =     new File("C://input.doc");
    FileInputStream     finput     =     new FileInputStream(fileIn);
    BufferedReader br     =     new BufferedReader(new InputStreamReader(finput,"Cp1252"));
    String lStrDoc_name     =     "1011";
              Conn.setAutoCommit(false);
              String lStrQuery     =     "insert into TESTPDF (" +"DOC_NAME,"+"DOCUMENT,"+"DOC_URL) "+" values(?,?,?)";
              pStmt = Conn.prepareStatement(lStrQuery);
              pStmt.setString(1,lStrDoc_name);
              pStmt.setBlob(2,newblob);
              pStmt.setString(3,"C://testing.doc");
              pStmt.executeUpdate();
              pStmt.close();
              Conn.commit();
              Statement     st     =     Conn.createStatement();
              ResultSet rs= st.executeQuery("select DOCUMENT from TESTPDF where DOC_NAME = " + lStrDoc_name + " for update");
              if(rs.next())
                   oracle.sql.BLOB blob=((oracle.jdbc.driver.OracleResultSet)rs).getBLOB(1);
                   System.out.println("BLOB-------->"+blob);
                   OutputStream outbb=blob.getBinaryOutputStream();
                   for(int i = 0; i < fileIn.length(); i++) {
                        outbb.write(br.read());
                   outbb.flush();
              rs.close();
              Conn.commit();
    Later i read the blob and store my output...
    the code is as follows....
    String lStrQuery     =     null;
              String lStrDoc_Name     =     "1011";
              String lStrDoc_Url     =     null;
              Blob newBlob     =     null;
              InputStream     fInput     =     null;
              BufferedReader br     =     null;
              FileOutputStream     fOutput     =     null;
              lStrQuery     =     "Select * from TESTPDF where DOC_NAME=" +lStrDoc_Name;
              try {
                   pStmt     =     Conn.prepareStatement(lStrQuery);
              } catch (SQLException e2) {
                   // TODO Auto-generated catch block
                   e2.printStackTrace();
              try {
                   rs = pStmt.executeQuery();
                   if(rs.next())
                        lStrDoc_Name     =     rs.getString(1);
                        newBlob               =     rs.getBlob(2);
                        lStrDoc_Url          =     rs.getString(3);
                        if(newBlob != null)
                             fInput = newBlob.getBinaryStream();
              } catch (SQLException e3) {
                   // TODO Auto-generated catch block
                   e3.printStackTrace();
              String lStrOutputFileName     =     "C://"+lStrDoc_Name+"testing.doc";
              try {
                   fOutput     =     new FileOutputStream(lStrOutputFileName);
              } catch (FileNotFoundException e5) {
                   // TODO Auto-generated catch block
                   e5.printStackTrace();
                   byte b;
                   try {
                        while ((fInput.read()) > -1) {
                             b = (byte) fInput.read();
                             fOutput.write(b);
                   } catch (IOException e4) {
                        // TODO Auto-generated catch block
                        e4.printStackTrace();
    The word document is stored in my local path.. but iwas not able to read the document. it opens in some ascii format..
    Your help is appreciated..

    BufferedReader br = new BufferedReader(new InputStreamReader(finput,"Cp1252"));Preserving the format would include not mangling it by using a Reader to read it. If you want to preserve it byte for byte then only use InputStream and OutputStream.

  • Search a Word Document for a particular word

    Hi,
    I want to search a Word Document based on a particular word, using Java technology.... Could any one of U suggest me a way out as to how to proceed, if possible with code....
    Thanks and Regards,
    Rajesh.

    POI can read & write Word docs.

  • How do you save a Word document when it says you have no memory?

    How do you save a Word document when it says you have no memory?

    Connect another disk drive to which you can save the document. Then clear space on your hard drive.
    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion's Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • HT202879 how can I open a Word document in Pages 09?

    How can I open a Word document using Pages 09 please? I am trying to open Word documents from a CD using both trying to open in Pages, nd dragging and dropping into the Pages icon in the dock. It tells me, every time, thast the document cannot be opened.

    What happens if you open it in TextEdit or LibreOffice [free]?
    Does it open where you got it from?
    Peter

  • IPad version:how can I search a word on modules?

    Hi to everybody! How can I search a word in modules?
    I understand that I can do a search in spreadsheet, but I need to do in a module that is more efficient...so do you know?
    And why when I write on module I can't press enter and begin to write a new line??
    Thanks!

    Touch the URL field at the top of the page, type your word and a list of possible searches will be shown. Near the bottom of this list will be "On this page" which shows hits on the page (if any). Touch this and you will be taken to the first match.

  • How do I generate a Word document and a PDF from Help files?

    Hi,
    I am new to RoboHelp HTML, and am using version 8.  I updated some Help files, and now I want to generate output.  Here are my questions/ or the process I used:
    To compile the help, I clicked Generate Primary Layout.  Is this correct?  I noticed that the date stamp on the xpj file has not changed.  The date is still from many months ago.  (Why is that?  Should it show a recent update date?)  However, the files that I updated do reflect the dates when I made the updates.  These include art files, an hhp, and htm, js, ldb, pss, cpd files.
    To generate a pdf, I clicked Generate PDF.  I was not able to generate the PDF at first, but then, I enabled macros in Word 2007 (Trust Center Settings > Enable all macros...and clicked the checkbox, Trust access to the VBA project object model), and clicked Generate PDF.  At the end of the generation, I got this error in Word: Microsoft Office Word has encountered a problem and needs to close.  We are sorry for the inconvenience.  The info you were working on might be lost.  Word can try to recover it for you.  I closed the dialog and Word generated several blank documents.  Microsoft Office Diagnostics was run and found one problem and corrected it.  Despite the error message, a pdf was generated.  (If you could give me any insight on why I got the error messages, that could be helpful to know).
    How do I generate a Word document?
    Thank you!
    Erin

    Welcome to our community
    Note that RoboHelp is capable of creating a variety of layouts. WebHelp, FlashHelp, AIR Help, Microsoft HTML Help, JavaHelp, Oracle Help, ePub and more.
    Any of these layouts may be nominated as the Primary layout. So when you generate the Primary layout, you get whatever has been configured as the Primary layout.
    Only certain actions will result in a change to the .XPJ file. The actions are indicative of major changes to the project. So I wouldn't fret the fact that the date time stamp wasn't updated.
    Indeed the Printed Documentation Single Source Layout recipe is what you use to create PDF. Generally what happens is that RoboHelp creates a Microsoft Word document as an intermediate file type, then creates the PDF from that. As you might imagine, there are a host of things that can go wrong during the process. I might suggest that you first get a Word document to generate cleanly. Then once you do that, focus on PDF. I know that I typically gen a Word document and stop there. I just open Word and use Word to create the PDF.
    If you look at the properties for the Printed Documentation Single Source Layout recipe (View > Pods > Single Source Layouts then right-click the Printed Documentation layout and choose Properties) you will see that PDF, Word or both are options at the top of the dialog.
    Hopefully that gives you a nudge in the right direction.
    My fellow Adobe Community Expert Peter Grainge has excellent info on Printed Documentation on his site at Grainge.org. Click the link below for that.
    Click here to visit Peter's site
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

  • How do I convert a word document into a pdf and then upload it to a web site

    How do I convert a word document into a pdf and then upload it to a web site so people can read it from my
    site with Dreamweaver 4?. How can I do this? Can anyone please help? I'm only a newbie. Thanking you in anticipation.

    First you need to install a means of printing to pdf from word.  I like cutepdf writer ( http://cutepdf.com/Products/CutePDF/writer.asp ).  Once installed you will print the doc in word and under the printer selection you choose pdf.
    Once you have the file you put it in your local site folders and upload it using Dreamweaver.  Be sure to link to it from a page so users can get to it and I would recommend giving the link a target of _black so it will open in a new window (see the properties inspector in DW).

  • How can I attatch a word document to an email that have already been sent to me in another email?, How can I attatch a word document to an email that have already been sent to me in another email?

    How can I attatch a word document to an email that have already been sent to me in another email?,

    Forward the original E-Mail and tap "Include Attachments".

  • How do you recover a word document on macbook pro?

    How do you recover a word document on a macbook pro?

    gwils wrote:
    How do you recover a word document on a macbook pro?
    Just as you do it on a Mac Pro or a Mac Mini.
    What version of Mac OS X? What version of MS Word?
    If you're thinking of the AutoRecover feature, you have to enable it first. If it was enabled, this
    <http://kb.iu.edu/data/ahnd.html#FindingfilesMac>
    will tell you what to do.

  • How do I convert a word document to a pdf document that is protected

    How do I convert a word document to a pdf document that is protected

    Use Acrobat, or possibly CreatePDF.

Maybe you are looking for

  • Access iTunes from AirPort Time Capsule

    Hi there, I have limited HD space on my MacBook Air and would like to store and access my iTunes library from my AirPort Time Capsule.  Is that possible?  If so, could someone please provide me with the steps to move my library to my AirPort Time Cap

  • Sound does not work

    I know this is a frequent topic, but i couldn't find the answer in wiki or anywhere else. I have a fresh installation of arch, everything works fine except sound. [root@jachym jachym]# hwd -s|grep Sound Sound(a) : 82801I ICH9 Family HD Audio Controll

  • FlashMX problem in Windows7

    I have been using FlashMX  since about 2003 and have produced hundreds of movies and web sites. I recently upgraded from WindowsXP to Windows7. What a nightmare - Windows 7 that is. It as created havoc with many files. My FlashMX authoring program ru

  • Re:Shortfall of 3 Days against SLED in current item (22.01.2010)

    Dear All, I am recieving this message when I am trying to do a GR against a process order. The order qty.: 150 ist GR was for 50. there was not problem But today when I am tring to do the second GR against this order the system is giving me this mess

  • Installing Windows 7 over Parallels

    Ok, I'm at a loss why Win7 won't install.  I've done this many times before on other Macs with no problem.  YES, I've read the instructions (pretty much have them memorized now).  The only thing I can see is maybe Parallels/Windows is botching things