Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fast Deletion of records from TPS files

Status
Not open for further replies.

SachinGandhi

Programmer
Sep 2, 2003
19
CA
I'm using C5.5F.

I have 2 .TPS files with parent child like relation.

I want to delete all the child records before deleing the parent record. It takes long time in doing this process.

Is there any way the deletion time can be reduced for .TPS files.

Thanks
 
Sachin,

Use LOGOUT() and delete within a transaction frame. Makes a world of difference.

By the way, is the deletion taking place automatically by virtue of the CASCADE relation in the dictionary between the Parent and Child tables?

Regards
 
Shankar,

There is no relationship set in the DCT. I'm manually deleting the child records from one file before deleting the parent record from the other file.

Its in a LOOP cycle.

If I use LOGOUT() and then COMMIT after the deletion process, and in that time if another process tries to add records to the same files. Will it have any problems like Access denied etc.

Thanks.
 
Sachin,

Yes. LOGOUT locks the tables. But how many child records will be there for a delay to be very obvious? If locking the file is not an option define a source procedure to delete the child records in the background on another thread. So if DeleteChildRecords is the procedure, you can execute a START(DeleteChildRecords, 25000, <parentlinkcolumn>) which will delete it in the background. Of course, with this approach you cannot wait for a confirmation before deleting the parent record.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top