BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to quickly delete a bunch of records from Table?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Qimiao Lu
Guest





PostPosted: Fri Jul 30, 2004 2:16 pm    Post subject: How to quickly delete a bunch of records from Table? Reply with quote



Hi,

Does anyone know how to remove the selected records (more than one ) from a
table quickly? Right now, I am using TTable->Delete to delete each selected
record through loop. It is very slow. Thanks in advance.

Regards.

Qimiao


Back to top
Jim Faulkner
Guest





PostPosted: Thu Aug 05, 2004 7:33 pm    Post subject: Re: How to quickly delete a bunch of records from Table? Reply with quote



Turn off auto-commits and commit after you delete the records.

"Qimiao Lu" <qlu (AT) baird (DOT) com> wrote

Quote:
Hi,

Does anyone know how to remove the selected records (more than one ) from
a
table quickly? Right now, I am using TTable->Delete to delete each
selected
record through loop. It is very slow. Thanks in advance.

Regards.

Qimiao





Back to top
Qimiao Lu
Guest





PostPosted: Mon Aug 09, 2004 1:10 pm    Post subject: Re: How to quickly delete a bunch of records from Table? Reply with quote



Thanks. How to turn off auto-commits? I could not find any property and
method relating to Auto-commits. Do you mean to use the block like this:

StartTransaction

delete all records;

Commit

Thanks again

Qimiao



"Jim Faulkner" <jim.faulkner (AT) bocc (DOT) citrus.fl.us> wrote

Quote:
Turn off auto-commits and commit after you delete the records.

"Qimiao Lu" <qlu (AT) baird (DOT) com> wrote in message
news:410a5849$1 (AT) newsgroups (DOT) borland.com...
Hi,

Does anyone know how to remove the selected records (more than one )
from
a
table quickly? Right now, I am using TTable->Delete to delete each
selected
record through loop. It is very slow. Thanks in advance.

Regards.

Qimiao







Back to top
Jim Faulkner
Guest





PostPosted: Mon Aug 09, 2004 2:47 pm    Post subject: Re: How to quickly delete a bunch of records from Table? Reply with quote

Basically, yes -- but it really all depends on the RDBMS that you are using
and which data controls --


"Qimiao Lu" <qlu (AT) baird (DOT) com> wrote

Quote:
Thanks. How to turn off auto-commits? I could not find any property and
method relating to Auto-commits. Do you mean to use the block like this:

StartTransaction

delete all records;

Commit

Thanks again

Qimiao



"Jim Faulkner" <jim.faulkner (AT) bocc (DOT) citrus.fl.us> wrote in message
news:41128b8f$1 (AT) newsgroups (DOT) borland.com...
Turn off auto-commits and commit after you delete the records.

"Qimiao Lu" <qlu (AT) baird (DOT) com> wrote in message
news:410a5849$1 (AT) newsgroups (DOT) borland.com...
Hi,

Does anyone know how to remove the selected records (more than one )
from
a
table quickly? Right now, I am using TTable->Delete to delete each
selected
record through loop. It is very slow. Thanks in advance.

Regards.

Qimiao









Back to top
dcent
Guest





PostPosted: Sun Aug 29, 2004 7:47 pm    Post subject: Re: How to quickly delete a bunch of records from Table? Reply with quote

Use a TQuery. Set the SQL property to some like:
DELETE * FROM table_name WHERE LastUpdate < '01/01/1999'


Qimiao Lu wrote:
Quote:
Hi,

Does anyone know how to remove the selected records (more than one ) from a
table quickly? Right now, I am using TTable->Delete to delete each selected
record through loop. It is very slow. Thanks in advance.

Regards.

Qimiao




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.