Delete all rows in a custom DB table from a Table Conversion Program

Cathy Wilbur

Well Known Member
One of our table conversion programs was clearing the output file after it completed running. We cannot do this because we have 3 output files and we only want to clear one of them. So we decided to use business functions B8000002 and B8000007 to help in clearing our custom DB table. It is a custom table we want to clear all the rows for (F55CHEQR). Please advise if we are on the right track. See attached word document identifying our idea. Need to make sure we are on the right track because we need to correct a production problem.
 

Attachments

  • 112411-Removing all rows within a DB Table in a TC Program.doc
    145 KB · Views: 149
I guess if it deletes all the tables in your database you'll know it didn't work
grin.gif




Seriously though, it should work. Give it a shot in DV, or PY. You'll find out pretty quickly.
 
Cathy,

It seems your logic works. These BSFN's will delete all the rows from your custom table that you have specified. To make sure test it once in your DV and TS environment. Attempting directly in PD is not safe.

Good luck
 
Hi,

The logic specified by you is correct. But you need to use FreeInputOutputEnvHandles Business function to free the resources.So the sequence should be like this.

1.Get InputOutput Env Handles
2.Delete All Rows From Table
3.FreeInputOutputEnvHandles

Regards,
Anjali
 
I do not look at the BSFNS. But I would think if you have a common field like Job # for the job as a filed in that file, after everything is done, at the end you can go and do a delete selecting that common Job # and It should delete all the records for that Job. Means all the existing records in that file.

Mali
 
Back
Top