Use the ADD_GROUP_COLUMN procedure to add a new column to an existing record group. The record group to which you add the column must meet the following criteria:
Note that when you add a column to a query record group you must also replace the group's current query with a new query that selects values into the new column.
/* The following example adds a column to a query record
** group that was created by a call to CREATE_GROUP_FROM_QUERY
** and currently has rows returned by that query.
*/
DECLARE
query_ok NUMBER;
BEGIN
/* This is a query group that has rows from a previous call
** to Populate_Group, so first delete all its rows
*/
Delete_Group_Row('prod_group',ALL_ROWS);
/* Now add a column of type DATE_COLUMN to the group */
Add_Group_Column('prod_group', 'restock_Date', DATE_COLUMN);
/* The structure of group's old query is no longer valid, so
** replace that query with a new query and populate the group
*/
query_ok := Populate_Group_With_Query('prod_group',
'SELECT product.id, product.name, inventory.warehouse_id,
inventory.amount_in_stock, inventory.restock_Date FROM product,
inventory WHERE product.id = warehouse.product_id');
/* if the query failed, abort this trigger by raising a
** predefined exception */
IF query_ok <> 0 THEN
RAISE Form_Trigger_Failure;
END IF;
END;
About Record Group Data Length Semantics
About Record Group Built-in Subprograms