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

Creating and Populating Non-Query Record Group

Non-query record groups can only be created at runtime.

Use the CREATE_GROUP function to create a non-query record group. Because the CREATE_GROUP function creates a group without columns or rows, it is usually followed by calls to the functions ADD_GROUP_COLUMN and ADD_GROUP_ROW.

CREATE_GROUP is a function that returns the internal ID of the new group. ADD_GROUP_COLUMN returns the ID of the new column. When you assign these IDs to variables of type Record Group and Group Column, you can reference them in subsequent operations.

You can also use POPULATE_GROUP_WITH_QUERY to populate a non-query group. Doing so associates the indicated query with the group and so converts the non-query group into a query group. The database columns referenced in the new query must correspond to the columns in the record group.

For example, you could build a non-query record group that has the appropriate columns, and then call POPULATE_GROUP_WITH_QUERY to associate a query with the group.

Creating and populating a non-query record group: Examples

/* The following example creates a record group called my_group.
** The resulting group is a three-column non-query record group
** that does not yet contain any rows.
*/

DECLARE
group_id  RecordGroup;
col1_id  GroupColumn;
col2_id  GroupColumn;
col3_id  GroupColumn;

BEGIN
/* Create a non-query group called my_group and assign its id
** to the variable group_id.
*/
group_id := Create_Group('my_group');

/* Add three columns to the new group, using the variable
** group_id to identify the group. The first two columns
** are of type CHAR_COLUMN and their length must be
** specified.
** The third is of type NUMBER_COLUMN and does not take a
** length parameter
*/
col1_id := Add_Group_Column(group_id,'col1',CHAR_COLUMN,50);
col2_id := Add_Group_Column(group_id,'col2',CHAR_COLUMN,50);
col3_id := Add_Group_Column(group_id,'col3',NUMBER_COLUMN);

END;


About record group Built-in subprograms

About manipulating a record group at runtime

Modifying an existing record group

Performing operations on rows

ADD_GROUP_COLUMN Built-in

ADD_GROUP_ROW Built-in

POPULATE_GROUP Built-in

POPULATE_GROUP_WITH_QUERY Built-in