Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Archiving records

In my application I would like to archive old records in an Invoice table to make it more manageable. Do any of you have some suggestions on what has worked well for you in some of your applications? My initial thoughts are to do the following:

1) Create table to place archived data
2) Select records to archive
3) Loop through records
4) Copy record to archive table
5) Delete from active table

I'd like to hear any tips you may have.

Comments

  • Is this just a one time maintenance task or is this something you intend to implement as a regularly used utility or perhaps even something that runs automatically?
  • I plan to implement it as a regularly used utility.
  • If this was a one time task, or even if it is used occasionally, I would have suggested to just create a select list and use the copy_row command with the option to delete the source row. You can do this from TCL or the System Monitor.

    If you intend this to be a regularly used utility - presumably one that you will hook up to your main application window in some way - then I suspect you'll want this to be a little more elegant. How important is it for you to track progress (e.g., a progress bar)? Is it sufficient to just start the process and show a wait cursor or some kind of wait banner?
  • I don't need it to be elegant with a progress bar. Just a wait banner would be sufficient.
  • edited June 2023
    In that case you could write a routine that calls the COPY_ROW subroutine. This would replace steps 3-4-5 with one command. You would just need to worry about the data selection, the display of a wait banner, and the dismissal of the wait banner.
  • That sound great. Thanks for the help.
Sign In or Register to comment.