Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2004, 08:02 AM
awfdml1 awfdml1 is offline
Junior Member
 
Join Date: Oct 2004
Posts: 2
Default TDBSearch and stored procedures

hello,

I'm a Delphi newbie here and I would like to know if there is anyway that I can use either TDBSearch with stored procedures. I am trying to find information about this tool. If I cannot use this tool or there is no one that is familiar with it, is there any way that I can do the following:

I am executing a stored procedure and I am returning a long list of values from various tables. Instead of having the user wait until the stored procedure is done executing, I would like data to appear on my screen while the stored procedure is being executed...same way the search mechanism is used. Is anyone familiar of a technique that can be used to do this?

I hope my question is clea and I would appreciate ANY help!

Thank you!
Reply With Quote
  #2  
Old 10-20-2004, 09:06 AM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: TDBSearch and stored procedures

You can see the progress of the stored procedure at the client because stored procedures are executed at the server level. You could modify your stored procedure to write information to another table table and then make your client app monitor that table and do a refresh every 5 or so seconds. This will of cource slow your storedprocedure down because it has to execute writes and commits to another table. IF it is a small process then this may not be an issue. Oh and to make somthing that refreshes every 5 seconds you can use a TTimer to do this...


procedure TMainForm.Timer1Timer(Sender: TObject);
begin
Query1.Close;
Query1.Open;
{Best way to refresh queries to reexecute prameters if any}
end;

Query1 would use the new Monitor table in it Select statment. You will probably want to tie a dbGrid or dbEdit to the Query1 to be able to watch the progress.
I hope this is what you are looking for.
Reply With Quote
  #3  
Old 10-20-2004, 09:51 AM
awfdml1 awfdml1 is offline
Junior Member
 
Join Date: Oct 2004
Posts: 2
Default RE: TDBSearch and stored procedures

That is exactly what I am looking for. Thank you!

The stored procedure I am using is a huge process but nonetheless I think I have no choice but to write the data to another table in order to view the data as the stored procedure is executing.

I am planning on tying a TStringGrid to the results of the select query. Can I set the refresh time for the timer or is it just defaulted to 5 seconds? Also, I have other things that will appear on my form, will the timer refresh my entire screen or will it just refresh based on the query and the grid?

Thanks so much!
Reply With Quote
  #4  
Old 10-20-2004, 10:52 AM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: TDBSearch and stored procedures

There is an .INTERVAL property for the TTimer. It is in 1000nths of a second so set it to 5000 for 5 seconds.

Ace
Reply With Quote
  #5  
Old 10-20-2004, 10:53 AM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: TDBSearch and stored procedures

Oh and you will need to do an

Applications.Processmessages;

To refresh the screen and any other threads running in your program, other wise it will not show the results until it has finished.

Ace
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:40 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.