码迷,mamicode.com
首页 > 数据库 > 详细

Oracle Form Builder:CREATE_GROUP Built-in

时间:2016-03-31 16:19:16      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

 

Description                                                                                                   

Creates a non-query record group with the given name. The new record group has no columns and no rows until you explicitly add them using the ADD_GROUP_COLUMN, the ADD_GROUP_ROW, and the POPULATE_GROUP_WITH_QUERY Built-ins.

Syntax                                                                                                           

FUNCTION CREATE_GROUP

(recordgroup_name VARCHAR2,

scope NUMBER,

array_fetch_size NUMBER);

Built-in Type unrestricted function

Returns RecordGroup

Enter Query Mode yes

 

Parameters                                                                                                                 

recordgroup_name    

   The string you defined as the name of the record group at design time. When Oracle Forms creates the record group object it also assigns the object a unique ID of type RecordGroup. You can call the record group by name or by ID in later calls to record group or record group column built-in subprograms.

scope   

   Specifies whether tlhe record group can be used only within the current form or within every form in a multi-form application. Takes the following constants as arguments:  

   FORM_SCOPE  Indicates that the record group can by used only within the current form. This is the  default value.  

   GLOBAL_SCOPE  Indicates that the record group is global, and that it can be used within all  forms in the application. Once created, a global record group persists for the remainder of the runtime session.

array_fetch_size   

  Specifies the array fetch size. The default array size is 0.

CREATE_GROUP Examples                                                                                  

/*** Built-in: CREATE_GROUP ** Example: Creates a record group and populates its values ** from a query. */
DECLARE
  rg_name VARCHAR2(40) := ‘Salary_Range‘;
  rg_id   RecordGroup;
  gc_id   GroupColumn;
  errcode NUMBER;
BEGIN
  /* ** Make sure the record group does not already exist.*/
  rg_id := Find_Group(rg_name); /* ** If it does not exist, create it and add the two ** necessary columns to it. */
  IF Id_Null(rg_id) THEN
    rg_id := Create_Group(rg_name); /* Add two number columns to the record group */
    gc_id := Add_Group_Column(rg_id, ‘Base_Sal_Range‘, NUMBER_COLUMN);
    gc_id := Add_Group_Column(rg_id, ‘Emps_In_Range‘, NUMBER_COLUMN);
  END IF; /* ** Populate group with a query */
  errcode := Populate_Group_With_Query(rg_id,
                                       ‘SELECT SAL-MOD(SAL,1000),COUNT(EMPNO) ‘ ||
                                       ‘FROM EMP ‘ ||
                                       ‘GROUP BY SAL-MOD(SAL,1000) ‘ ||
                                       ‘ORDER BY 1‘);
END;

Oracle Form Builder:CREATE_GROUP Built-in

标签:

原文地址:http://www.cnblogs.com/pompeii2008/p/5341201.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!