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

POPULATE_GROUP_WITH_QUERY Built-in

Description

Populates a record group with the given query. The record group is cleared and rows that are fetched replace any existing rows in the record group.

If the SELECT statement fails, Oracle Forms returns an ORACLE error number, which can be tracked with SQLERRM,
if you change the sign to -. If the query is successful, this Built-in returns 0 (zero).

You can use this Built-in to populate record groups that were created by a call to either:

When you use this Built-in, the indicated query becomes the default query for the group, and will be executed whenever the POPULATE_GROUP Built-in is subsequently called.

Note: Be aware that the POPULATE_GROUP_WITH_QUERY array fetches 20 records at a time. To improve network performance, you may want to restrict queries, thus limiting network traffic.

Syntax

FUNCTION POPULATE_GROUP_WITH_QUERY
(recordgroup_id RecordGroup,
query
VARCHAR2);

FUNCTION POPULATE_GROUP_WITH_QUERY
(recordgroup_name VARCHAR2,
query
VARCHAR2);

Built-in Type unrestricted function

Returns NUMBER

Enter Query Mode yes

Parameters

recordgroup_id 
 
The unique ID that Oracle Forms assigns when it creates the group. The data type of the ID is RecordGroup.
 
recordgroup_name 
 
The name you gave to the record group when creating it. The data type of the name is VARCHAR2.
 
query 
 
A valid SELECT statement, enclosed in single quotes. Any columns retrieved as a result of the query take the data types of the columns in the table. If you restrict the query to a subset of the columns in the table, then Oracle Forms creates only those columns in the record group. The data type of the query is VARCHAR2.

POPULATE_GROUP_WITH_QUERY Restrictions

  • The columns specified in the SELECT statement must match the record group columns in number and type.
  • POPULATE_GROUP_WITH_QUERY Example

    /*

    ** Built-in: POPULATE_GROUP_WITH_QUERY
    ** Example: See CREATE_GROUP
    */