Consultor Eletrônico



Kbase P67740: Is there an easy way to purge or delete data from the databa
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/13/2004
Status: Unverified

GOAL:

Is there an easy way to purge or delete data from the database?

FIX:

Yes, there is.  Simply using the FOR EACH and DELETE statements along with an appropriate WHERE clause on the FOR EACH statement.  An example is shown below.

FOR EACH SomeTable WHERE SomeTable.SomeField LT 'SomeTargetValue':
   DELETE SomeTable.
END.

Obviously, the WHERE clause can be as simple or complex as needed.  We strongly suggest that a backup the database be taken before purging records just in case records are removed that should not have been removed.