` Printed Icetips Article

Icetips Article



Par2: Batch adding records
2008-08-24 -- Paul Howard
 
Yes, for TPS, LOGOUT/COMMIT every 1000 records or so is faster than 
STREAM/FLUSH every 1000 records, and works on shared files.  Avoid this 
tight loop for anything but small sets of adds cus it will be unfriendly 
towards other processes and users and there is no way to bail, no screen 
refreshes, etc.  Use the report or process template and add a 
logout/commit every 1000 records. Add LOGOUT after parent.OpenReport if 
returnvalue = 0 (yes, there is an OpenReport in Process!), add 
COMMIT,LOGOUT after parent.TakeRecord when (SELF.RecordsProcessed % 
1000) = 0) and add final COMMIT in TakeCloseEvent.  FWIW, I have an 
include file that is used to copy all records between two files and 
rebuild keys with progress and bailout using a timer.  It's very fast 
and includes an option to use either stream or logout.  STREAM is faster 
than LOGOUT on Btrieve and maybe other drivers.  TPS LOGOUT is very fast 
as long as you commit in chunkes.



Printed November 23, 2024, 3:39 am
This article has been viewed/printed 35219 times.