You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Using InsertRow Function for copying values from one rowset to another.

1 reply [Last post]
Guest's picture
Guest

Hi All,
I am working with rowsets for my current requirement and trying to insert values from one rowset to another. I have a rowset which gets values one row at a time from a fileLayout,inside a While Loop. And i am trying to insert this Values into another Rowset which must consist of all the values that comes from the file. It might be clear from the example below.

&rsRepDtlsTmp = CreateRecord(Record.RECORD1);
&rs1 = CreateRowset(Record.RECORD1);
While &rsFile <> Null
&rsFile.GetRow(1).RECORD1.CopyFieldsTo(&rsRepDtlsTmp);
&rs1.Insertrow(0);
MessageBox(0, "", 0, 0, &rs1.getrow(1).RECORD1.FIELD1.value);
End-While;

I was trying to fetch values from a file into the work record &rsRepDtlsTmp,row by row and then insert it into another rowset &rs1 and try to get the value through a message box. But this seems to be not working...Any thoughts why??

Guest's picture
Guest (not verified)
Re: Using InsertRow Function for copying values from one ...

Here is your code revised.

&rsRepDtlsTmp = CreateRecord(Record.RECORD1);
&rs1 = CreateRowset(Record.RECORD1);
While &rsFile <> Null
&rsFile.GetRow(1).RECORD1.CopyFieldsTo(&rsRepDtlsTmp);
&rs1.Insertrow(1);
&rsRepDtlsTmp.copyfieldsto(&rs1.GetRow(1).RECORD1);
MessageBox(0, "", 0, 0, &rs1.getrow(1).RECORD1.FIELD1.value);
End-While;