How to copy datasource of a grid in a temporary or memory table

    MyTable MyTablecopy;
    MyTable MyTabletmp;

    Common Common;
    int row = 1;
    int rowmax;
    ;

    MyTabletmp.setTmp();
    MyTabletmp.clear();

    rowMax = MyTable_ds.totalNumberOfRows();
    Common = MyTable_ds.getFirst();
    while (row <= rowmax)
    {
        select firstOnly MyTablecopy where MyTablecopy.RecId == Common.RecId;
        if(MyTablecopy)
        {
            MyTabletmp.MyTableId = int2str(row);
            MyTabletmp.itemId =MyTablecopy.itemid;
            MyTabletmp.insert();
        }
        row++;
        Common = MyTable_ds.getnext();
    }

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.