November 16th, 2004, 08:01 PM
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
November 18th, 2004, 02:30 PM
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
November 18th, 2004, 04:56 PM
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....
November 19th, 2004, 09:30 AM
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?