Thursday, April 2, 2009

PeopleCode: GetRowset

Local Rowset &rs1, &rs2;

&rs1 = GetLevel0()(1).GetRowset(Scroll.LEVEL_1_VW); /* Level 1 Rowset */
&rs1.Flush(); /* Flush Level 1 Rowset */

&count = &rs1.Select(Record.
LEVEL_1_VW, "WHERE EMPLID = :1 ", DERIVED_TBL.EMPLID); /* Insert data into Level 1 Rowset */

For &i = 1 To &rs1.ActiveRowCount; /* Loop Level 1 Rowset */
&r1 = &rs1(&i);


&rs2 = &r1.GetRowset(Scroll.
LEVEL_2_VW); /* Level 2 rowset */
&rs2.Flush();

&cnt = &rs2.Select(Record.
LEVEL_2_VW, "WHERE EMPLID = :1 AND YEAR=:2", DERIVED_TBL.EMPLID, &r1.LEVEL_1_VW.YEAR.VALUE);

For &j = 1 To &rs2.ActiveRowCount;

&r2 = &rs2(&j);
&amount = &r2.
LEVEL_2_VW.AMOUNT;
End-For;


End-For;


No comments: