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

Counting the Number of Rows in a Record Group

You can determine the number of rows in a record with the function GET_GROUP_ROW_COUNT. This function is useful for determining how many iterations are required to loop through all the rows in a given group.

Counting the number of rows in a record group Examples

/* The following example first executes the query
** associated with the query group named my_group,
** then assigns the number of rows returned by the
** query to the variable row_count.
*/

DECLARE
group_id  RecordGroup;
query_ok  NUMBER;
row_count  NUMBER;
BEGIN
query_ok := Populate_Group('my_group');
row_count := Get_Group_Row_Count(group_id);
END;

/* The following example demonstrates the use of
** GET_GROUP_ROW_COUNT to determine how many iterations
** are required to loop through all of the rows in a
** given group.
*/

DECLARE
group_id RecordGroup := FIND_GROUP('my_group');
row_count NUMBER;

BEGIN

/* find out how many rows are in the group */

row_count := Get_Group_Row_Count(group_id);  

/* set the group's Status column to 'discontinued' for any
** rows with product id of 471
*/

FOR j IN 1..row_count LOOP
IF Get_Group_Number_Cell('my_group.prod_id', j) = 471
THEN Set_Group_Char_Cell (my_group.status, j, 'discontinued');
END LOOP;
END;
 


About record group Built-in subprograms

About manipulating a record group at runtime

Modifying an existing record group

GET_GROUP_ROW_COUNT Built-in