You can programmatically mark rows as "selected" when you perform row operations. Selecting a row sets an internal flag on the row that you can refer to in subsequent row operations.
/* The following trigger loops through all of the rows in
** the group orders. If the Date stored in a row's
** Date_ordered column is prior to 1980, the row is marked
** as selected.
*/
DECLARE
group_id RecordGroup := FIND_GROUP('orders');
row_count NUMBER;
old_orders NUMBER;
BEGIN
/* determine how many orders there are */
row_count := Get_Group_Row_Count(group_id);
/* if an order is older than 1980, mark it for selection */
FOR j IN 1..row_count LOOP
IF Get_Group_Date_Cell('orders.Date_ordered', j) <
'01-JAN-80' THEN
Set_Group_Selection(group_id, j);
END IF;
END LOOP;
/* count the total number of old orders */
old_orders := Get_Group_Selection_Count(group_id);
END;
/* The following example is a procedure called kill_rows.
** The procedure takes a CHAR parameter that allows the name
** of a record group to be passed in at runtime. The procedure
** deletes all of the rows in the group that are currently
** selected.
*/
PROCEDURE kill_rows(group_name IN CHAR) IS
group_id RecordGroup := Find_Group('group_name');
counter NUMBER := 1;
marked_rows NUMBER;
BEGIN
/* determine how many rows are marked as selected */
marked_rows := Get_Group_Selection_Count(group_id);
/* delete each row marked as selected */
WHILE counter <= marked_rows LOOP
Delete_Group_Row(group_id,
Get_Group_Selection(group_id,counter));
counter := counter + 1;
END LOOP;
About record group Built-in subprograms
About manipulating a record group at runtime
Modifying an existing record group
GET_GROUP_SELECTION_COUNT Built-in