Monday 29 July 2013

RECORD GROUPS

There are three types of record groups:

A.    query record groups
B.    static record groups
C.    non-query record groups.

Query Record Group:
A record group is an internal Form Builder data structure that has a column/row framework similar to a database table.  However, unlike database tables, record groups are separate objects that belong to the form module in which they are defined. A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or DATE provided that the total number of columns does not exceed 64K.  Record group column names cannot exceed 30 characters. Programmatically, record groups can be used whenever the functionality offered by a two-dimensional array of multiple data types is desirable.

A record group built from a query can store records from database tables much like a database view, with the added advantage that the record group is local to Form Builder, rather than existing in the database.  Also, the SELECT statement used to create and populate a query record group can be constructed dynamically at runtime.

A query record group is a record group that has an associated SELECT statement. The columns in a query record group derive their default names, data types, and lengths from the database columns referenced in the SELECT statement.  The records in a query record group are the rows retrieved by the query associated with that record group.

Non-query Record Group:
 A non-query record group is a group that does not have an associated query, but whose structure and values can be modified programmatically at runtime.

Static Record Group:                         
A static record group is not associated with a query; rather, you define its structure and row values at design time, and they remain fixed at runtime.

At design time, you can create query record groups and static record groups. 
At runtime, you can programmatically create query record groups and non-query record groups.

When you create a record group, you do not specify its type explicitly; rather, the type is implied by when you create the record group (At design time or programmatically at runtime) and by how you define the group.

A)  CREATE_GROUP_FROM_QUERY:
Creates a record group with the given name. The record group has columns representing each column you include in the select list of the query. Add rows to the record group with the POPULATE_GROUP built-in.

FUNCTION CREATE_GROUP_FROM_QUERY
  (recordgroup_name  VARCHAR2,
   query             VARCHAR2); 

FUNCTION CREATE_GROUP_FROM_QUERY
  (recordgroup_name  VARCHAR2,
   query             VARCHAR2,
   scope             NUMBER,
   array_fetch_size  NUMBER);


B)  CREATE_GROUP
Restrictions on Record Groups The type of record group (static, query, or non-query) and when the group was created (at design time or programmatically at runtime) determine which built-in subprograms are valid for a particular group.

For example, you cannot use the ADD_GROUP_COLUMN function to add a column to a record group that was created at design time.  Similarly, you cannot use the ADD_GROUP_ROW procedure to add a row to a static record group.  The following sections describe the types of record groups for which each built-in is valid.

No comments:

Post a Comment