A script-enabled browser is required for this page to function properly.

DELETE_GROUP_ROW Built-in

Description

Deletes the indicated row or all rows of the given record group. Oracle Forms automatically decrements the row numbers of all rows that follow a deleted row. When rows are deleted, the appropriate memory is freed and available to Oracle Forms.

If you choose to delete all rows of the group by supplying the ALL_ROWS constant, Oracle Forms deletes the rows, but the group still exists until you perform the DELETE_GROUP subprogram.

When a single row is deleted, subsequent rows are renumbered so that row numbers remain contiguous.

Syntax

PROCEDURE DELETE_GROUP_ROW
(recordgroup_id RecordGroup,
row_number
NUMBER);

PROCEDURE DELETE_GROUP_ROW
(recordgroup_name VARCHAR2,
row_number
NUMBER);

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

recordgroup_id 
 
The unique ID that Oracle Forms assigns the group when it creates it. The data type of the ID is RecordGroup.
 
recordgroup_name 
 
The name you gave to the record group when you created it. The data type of the name is VARCHAR2.
 
row_number 
 
Specifies the row to be deleted from the record group. Rows are automatically numbered from 1 to n. Row number parameter data type is NUMBER.
 
ALL_ROWS
 
Specifies that Oracle Forms is to delete all rows without deleting the record group. ALL_ROWS is a constant.

DELETE_GROUP_ROW Restrictions

This Built-in cannot be used to delete rows from a static record group.

DELETE_GROUP_ROW Examples

/*

** Built-in: DELETE_GROUP_ROW
** Example: Delete certain number of records from the tail
** of the specified record group.
*/
PROCEDURE Delete_Tail_Records( recs_to_del NUMBER,
rg_name VARCHAR2 ) IS
rg_id RecordGroup;
rec_count NUMBER;
BEGIN
/*
** Check to see if Record Group exists
*/
rg_id := Find_Group( rg_name );
/*
** Get a count of the records in the record group
*/
rec_Count := Get_Group_Row_Count( rg_id );
IF rec_Count < recs_to_del THEN
Message('There are only '||TO_CHAR(rec_Count)||
' records in the group.');
RAISE Form_Trigger_Failure;
END IF;
/*
** Loop thru and delete the last 'recs_to_del' records
*/
FOR j IN 1..recs_to_del LOOP
Delete_Group_Row( rg_id, rec_Count - j + 1 );
END LOOP;
END;