mercredi 28 septembre 2011

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();
    }

Aucun commentaire:

Enregistrer un commentaire