Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004

    Question Unanswered: Read blob nonblocking


    I am writing a delphi program that updates it's self from the database. The new version is stored in a blob field. The problem is that I want to have a progress bar when the program downloads the new version from the database. Even if I use a thread, I can only know when it starts and when it ends. How can I be aware of the download status or do block reading?

    I am using delphi 7 , odac4.5 , oracle 9.0.2

    what i'm currently doing looks something like this:

    query.sql.text := "select t.file_name, f.file from files f where f.file_name = prog1";;

    TBlobField(query.FieldByName('file')).SaveToFile(' c:\temp\tempfile.exe');

  2. #2
    Join Date
    Nov 2002
    Desk, slightly south of keyboard

    For block reading use the Oracle DBMS_LOB package.

    DBMS_LOB.GetLength( lobfield ) will give you the total lob size
    DBMS_LOB.Substr( lobfield, amount, offset ) will return a block of data as another LOB or as a VARCHAR2 (I believe it depends on the source lob type).

    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

  3. #3
    Join Date
    Dec 2004
    Thank you, will try it.

  4. #4
    Join Date
    Dec 2004
    I used another method to solve the problem.
    While the thread is reading the blob from the database, I do the following from the main thread:
    select * from v$session_longops where time_remaining > 1
    which gives me the estimated remaining time of the operation.
    It gives the following fields:
    TIME_REMAINING, ELAPSED_SECONDS, MESSAGE(info about the operation)

    Thanks again.

Posting Permissions

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