April 30, 2012

System Table as a Temp Table

How to use a system table as a Temporary Table 

We can use a system table as a temp table in our coding just try the following code....

static void CopyPersistedTableToTemp(Args _args)
{
    CustTable custTable;
    CustTable custTmpLedger;
    ;
    custTmpLedger.setTmp();
    custTable.recordLevelSecurity(true);

    while select custTable where custTable.City == 'Toronto'
    {
        custTmpLedger.data(custTable.data());
        custTmpLedger.doInsert();
     }
}



By using this code you can use a system table as a temp table and the good thing in this , this didnt disturb your main table configuration and data in that table. it just create a object of a table and use this object as a temporary.

No comments:

Post a Comment

Thanks