0% found this document useful (0 votes)
767 views3 pages

Get Group Char Cell

GET_GROUP_CHAR_CELL is a built-in function that returns the VARCHAR2 or LONG value for a record group cell identified by the given row and column. It has two syntax variations, one that specifies the group column ID and one that specifies the group column name. It returns the cell value as a VARCHAR2. The row number parameter must be within the bounds of the number of rows in the record group, otherwise it will result in an error.

Uploaded by

tmlrln
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
767 views3 pages

Get Group Char Cell

GET_GROUP_CHAR_CELL is a built-in function that returns the VARCHAR2 or LONG value for a record group cell identified by the given row and column. It has two syntax variations, one that specifies the group column ID and one that specifies the group column name. It returns the cell value as a VARCHAR2. The row number parameter must be within the bounds of the number of rows in the record group, otherwise it will result in an error.

Uploaded by

tmlrln
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

GET_GROUP_CHAR_CELL Built-in

Description
Returns the VARCHAR2 or LONG value for a record group cell identified by the given row and
column. A cell is an intersection of a row and column.

Syntax
FUNCTION GET_GROUP_CHAR_CELL
(groupcolumn_id GroupColumn,
row_number NUMBER);

FUNCTION GET_GROUP_CHAR_CELL
(groupcolumn_name VARCHAR2,
row_number NUMBER);

Built-in Type unrestricted function

Returns VARCHAR2

Enter Query Mode yes

Parameters
groupcolumn_id 
 
Specifies the unique ID that Forms Developer assigns when it creates the record group
column. Use the FIND_COLUMN built-in to return the ID to an appropriately typed variable.
The data type of the ID is GroupColumn.
 
groupcolumn_name 
 
Specifies the fully qualified VARCHAR2 record group column name you gave the column
when you defined it, preceded by the record group name and a dot, as in
recordgroup_name.groupcolumn_name. If the column was defined as a result of a query,
its name is the same as its corresponding database column.
 
row_number 
 
Specifies the row from which to retrieve the value of the cell.

GET_GROUP_CHAR_CELL Restrictions
The row_number specified must be within the bounds implied by the number of rows in the record
group. A non-existent row_number results in an index out of bounds error.
GET_GROUP_CHAR_CELL Examples
/*

** Built-in: GET_GROUP_CHAR_CELL
** Example: Search thru names in a static record group to
** determine if the value passed into this subprogram
** exists in the list. Returns the row number
** where the record was first located, or zero (0)
** if no match was found.
*/
FUNCTION Is_Value_In_List( the_value VARCHAR2,
the_rg_name VARCHAR2,
the_rg_column VARCHAR2)
RETURN NUMBER IS
the_Rowcount NUMBER;
rg_id RecordGroup;
gc_id GroupColumn;
col_val VARCHAR2(80);
Exit_Function Exception;
BEGIN
/*
** Determine if record group exists, and if so get its ID.
*/
rg_id := Find_Group( the_rg_name );

IF Id_Null(rg_id) THEN
Message('Record Group '||the_rg_name||' does not exist.');
RAISE Exit_Function;
END IF;

/*
** Make sure the column name specified exists in the
** record Group.
*/
gc_id := Find_Column( the_rg_name||'.'||the_rg_column );

IF Id_Null(gc_id) THEN
Message('Column '||the_rg_column||' does not exist.');
RAISE Exit_Function;
END IF;
/*
** Get a count of the number of records in the record
** Get a count of the number of records in the record
** group
*/
the_Rowcount := Get_Group_Row_Count( rg_id );

/*
** Loop through the records, getting the specified column's
** value at each iteration and comparing it to 'the_value'
** passed in. Compare the values in a case insensitive
** manner.
*/
FOR j IN 1..the_Rowcount LOOP
col_val := GET_GROUP_CHAR_CELL( gc_id, j );
/*
** If we find a match, stop and return the
** current row number.
*/
IF UPPER(col_val) = UPPER(the_value) THEN
RETURN j;
END IF;
END LOOP;

/*
** If we get here, we didn't find any matches.
*/
RAISE Exit_Function;
EXCEPTION
WHEN Exit_Function THEN
RETURN 0;
END;

You might also like