Board index » delphi » Setting fields in all records of a table

Setting fields in all records of a table

Hello,

I have 128000 records in one of my tables.
When the program starts, some fields in each record
should be set to 0. Doing this record by record
takes several minutes. Does anybody have an idea of
how could I do this faster ?

--
Zbigniew Lipinski
e-mai : z...@NOSPAMwebmedia.pl
www:  http://www.webmedia.pl/zl1

(Please remove the NOSPAM word when sending e-mail to me)

 

Re:Setting fields in all records of a table


What database are you using?
Can you / are you opening in exclusive mode?
Are you using SQL or TTable to change data?
Is the data local or residing on network?
Quote
Zbigniew Lipinski wrote in message <01bdf171$8cc8a4c0$LocalHost@ppp>...
>Hello,

>I have 128000 records in one of my tables.
>When the program starts, some fields in each record
>should be set to 0. Doing this record by record
>takes several minutes. Does anybody have an idea of
>how could I do this faster ?

>--
>Zbigniew Lipinski
>e-mai : z...@NOSPAMwebmedia.pl
>www:  http://www.webmedia.pl/zl1

>(Please remove the NOSPAM word when sending e-mail to me)

Re:Setting fields in all records of a table


Paradox 5.0 at the moment, probably soon it will be updated
to a newer version of Paradox.

By the way - It wouldn't be too good if the solution relied on the
physical structure ot the table as every update would require
changes in code.

I thought that maybe there was some BDE command to do this ?...

Thanks...

Z.L.

Bill Todd (TeamB) <bill_todd.nos...@compuserve.com> napisa3(a) w artykule
<6ve77k$kr...@forums.borland.com>...

Quote
> Not without knowing what database you are using?

Re:Setting fields in all records of a table


Use SetRange to select the records then use a while loop to iterate through
them and make the changes.  The other alternative is to use a query.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:Setting fields in all records of a table


I have tried the first method - it is too slow. I'll try the other
but I suspect that it won't be much faster.

Anyway - thanks for your help, Bill.
--
Zbigniew Lipinski

Bill Todd (TeamB) <bill_todd.nos...@compuserve.com> napisa3(a) w artykule
<6vh5ep$on...@forums.borland.com>...

Quote
> Use SetRange to select the records then use a while loop to iterate
through
> them and make the changes.  The other alternative is to use a query.

Other Threads