#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Guadalajara, Jalisco, México
    Posts
    62
    Rep Power
    10

    How to show progress on a long FB Query?


    I already made a program to transform some big text file for FB to take as an external table. The manually I'm giving an INSERT command, that takes 20 to 30 minutes to get done. I'm using IBExpress to do it, then I have to press the commit button.

    Now I want to add that funcionality to my Delphi app, so after processing the text file it automatically does the INSERT... COMMIT work, but I'm wondering how could I show some sort of progress indicator to tell the user at least how many records/bytes have been parsed. Any ideas? Thanks
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,624
    Rep Power
    4247
    You could write a trigger that posts an event every time a record is inserted. Then, the front end could use a TIBEvent component to catch this event and update a progress bar accordingly The trouble is, to show accurate progress, you must know how many rows are being inserted from the file in the first place.

    Another approach is to make a fake progress bar that is updated by a TTimer component and/or a TThread object. The progress bar should keep incrementing and when it reaches the max. value, it should clear it and start over again. Even better, make it increment in slight uneven jumps so the progress doesn't look smooth always. It isn't accurate, but it lets the user know that "something is happening" and that your application isn't stuck.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    50
    Rep Power
    10
    what if I am using a Query componets and passing SELECT staetment to it.... in this case, if my SELECT statement takes long time, will you still be able to show a progress bar? I doubt....
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Guadalajara, Jalisco, México
    Posts
    62
    Rep Power
    10
    Well, the Trigger/Event should do it for the long INSERT, I tought about writing a SP that every thousand or so records inserted posted an event, so no overflow would occur (I'm inserting 3 million records each time).

    Anybody could answer the SELECT part of the question?

IMN logo majestic logo threadwatch logo seochat tools logo