Home » Developer & Programmer » Forms » record groups
record groups [message #130074] Thu, 28 July 2005 01:43 Go to next message
prase_pk
Messages: 40
Registered: July 2005
Location: india
Member
can we assign one record group values to other ?

suppose we have rg1 and rg2.rg1 refers to table tab.
then can we assign rg2=rg1 or else some how that rg2 has all the values that are there in rg1 without directly interacting with my table tab? please help me
Re: record groups [message #130180 is a reply to message #130074] Thu, 28 July 2005 10:38 Go to previous message
Tafer
Messages: 64
Registered: July 2005
Location: Here!
Member
First:
Why you need 2 record groups with the same information?
What are you using? (Forms 6i, 9i, etc)

Now, there is a way to load the values from one record group to another:

This is a example found on the Oracle 6i documentation, this will help you to understand the basics of Record Group Manipulation:

/*

** 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
** 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;

To insert values in a record group use this:
To create a new row: ADD_GROUP_ROW
To modify its data: SET_GROUP_CHAR_CELL and similars.




Previous Topic: to check values in multirecord
Next Topic: HOW TO TAKE THE BACKUP WITH THE USE OF FORM
Goto Forum:
  


Current Time: Thu Sep 19 23:22:24 CDT 2024