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

ADD_GROUP_COLUMN Built-in

Description

Adds a column of the specified type to the given record group. When a record group is created dynamically (at run time), you can specify a column's data length semantics as a fifth parameter to this Built-in.  It can take values of 'BYTE' or 'CHAR' (which are valid only when the datatype is CHAR), or null.  A value of null in a CHAR column mapping indicates that the data length semantics is to be taken from the environment variable NLS_LENGTH_SEMANTICS.

Syntax

FUNCTION ADD_GROUP_COLUMN
(recordgroup_id RecordGroup,
groupcolumn_name
VARCHAR2,
column_type
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_name VARCHAR2,
groupcolumn_name
VARCHAR2,
column_type
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_id, RecordGroup
groupcolumn_name
VARCHAR2,
column_type
NUMBER,
column_width
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_name VARCHAR2,
groupcolumn_name
VARCHAR2,
column_type
NUMBER,
column_width
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_id, RecordGroup
groupcolumn_name
VARCHAR2,
column_type
NUMBER,
column_width
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_name VARCHAR2,
groupcolumn_name
VARCHAR2,
column_type
NUMBER,
column_width
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_id, RecordGroup
length_semantics
VARCHAR2,
column_type
NUMBER,
column_width
NUMBER);

FUNCTION ADD_GROUP_COLUMN
(recordgroup_name VARCHAR2,
length_semantics
VARCHAR2,
column_type
NUMBER,
column_width
NUMBER);

Built-in Type unrestricted function

Enter Query Mode yes

Returns GroupColumn

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.
 
groupcolumn_name 
 
Specifies the name of the column. The data type of the column name is VARCHAR2.
 
column_type Specifies the data type of the column. The allowable values are the following constants:

CHAR_COLUMN Specify if the column can only accept VARCHAR2 data.

DATE_COLUMN Specify if the column can only accept DATE data.

LONG_COLUMN Specify if the column can only accept LONG data.

NUMBER_COLUMN Specify if the column can only accept NUMBER data.

column_width 
 
If you specify CHAR_COLUMN as the column_type, you must indicate the maximum length of the data. COLUMN_WIDTH cannot exceed 2000, and must be passed as a whole number.
length_semantics
Specifies a column's data length semantics. It can take values of 'BYTE' or 'CHAR', which are valid only when the datatype is CHAR, or Null.  A value of Null in a CHAR column mapping indicates that the data length semantics is to be taken from the environment variable NLS_LENGTH_SEMANTICS. 

Error Conditions:

An error is returned under the following conditions:

ADD_GROUP_COLUMN Restrictions

ADD_GROUP_COLUMN Examples

/* ** Built-in: ADD_GROUP_COLUMN
** Example: Add one Number and one Char column to a new
** record group.
*/
PROCEDURE Create_My_Group IS
rg_name VARCHAR2(15) := 'My_Group';
rg_id RecordGroup;
gc_id GroupColumn;
BEGIN
/*
** Check to see if Record Group already exists
*/
rg_id := Find_Group( rg_name );
/*
** If Not, then create it with one number column and one ** Char column
*/
IF Id_Null(rg_id) THEN
rg_id := Create_Group( rg_name );
gc_id := Add_Group_Column(rg_id, 'NumCol',NUMBER_COLUMN);
gc_id := Add_Group_Column(rg_id, 'CharCol',CHAR_COLUMN,15);
END IF;
END;