Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms - Using Record Groups

Status
Not open for further replies.

thebull1

Programmer
Oct 24, 2001
68
I have a problem with accessing values from consequent or previous rows at post-change in a non-database datablock already populated using a cursor.
I was wondering whether a record group (never tried one before) can be used,....and if you can:-
1) change its where clause dynamically?
2) re-populate(refresh) the record group dynamically?

I'd be needing an updated record group for each of the rows and that is why I'm enquiring about its dynamism...
 
You could do this a couple of ways. The first step in both cases is to create the structure of your record group:

DECLARE
l_rg RECORDGROUP := Find_Group('group_name');
BEGIN
IF NOT Id_Null(l_rg)
THEN
Delete_Group(l_rg);
END IF;

l_rg := Create_Group_From_Query('group_name','SELECT .....');


Once you have created the structure, you can populate the group using either Populate_Group(l_rg); which will populate the group with data based on the SELECT statement you have defined, or row by row as you loop through your own cursor with something like this example:

l_count := Get_Group_Row_Count(l_rg) + 1;
Add_Group_Row(l_rg,END_OF_GROUP);
Set_Group_Char_Cell('group_name.column_1',l_count,'value');
Set_Group_Number_Cell('group_name.column_2',l_count,value);
.
.
.

etc.

If values in your form are updated you can update the values in your group using this:

Set_Group_Number_Cell('group_name.col_name',To_Number:)SYSTEM.TRIGGER_RECORD),value);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top