Progress
Programming
Handbook
Deleting Browse Rows
Deleting a record by way of a browse is a two-step process. When the user indicates a deletion, you should re-get the records EXCLUSIVE–LOCK NO-WAIT and then use the DELETE statement to remove the records from the database. Next, you would use the DELETE–SELECTED–ROWS( ) (plural) method to delete one or many selected records from both the browse widget and the query results list. DELETE–SELECTED–ROWS( ) is a newer and more efficient browse method and supercedes the old technique of using the DELETE–SELECTED–ROW( ) (singular) and DELETE–CURRENT–ROW( ) methods.
The code example below demonstrates an algorithm for deleting many rows from both the database and the browse. The technique also works for deleting single rows and records:
A button indicates that the user wants to delete the selected rows. Since the record begins with NO–LOCK, you must first re-get the record with EXCLUSIVE–LOCK NO–WAIT. After using the DELETE statement, to remove the record from the database, the DELETE–SELECTED–ROWS( ) method updates the query and browse.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |