How do I traverse a Temporary Table?

Hello,

This may sound obvious but I have actually never been in the scenario to learn this. I have a temporary table populated and I want to traverse it. I have tried the following:

while select tmpTable

{

// do something

}

Yet that doesn’t seem to do it…

Any answers or ideas will certainly be appreciated!

Actually, I believe the issue is more complicated because the temporary table is packed in the parent class which is passed from another form. I can’t seem to find any information regarding packing of temporary tables except for the following “Pack-Unpack Design Pattern” located in http://msdn.microsoft.com/en-us/library/aa879675.aspx. It just mentions it is possible to pack temporary tables. I simply provided it in the #localmacro.CurrentList section in my Class’s classDeclaration and pass it as a parameter from the caller form.

The weird thing is if I set a break point on the while, it shows there is a record in the buffer yet the while statement is never executed. I tried to also print the number of records but I actually get a 0 record count using the following:

void tmpCount()

{

TmpTable tmpTableCount;

int64 recordCount;

;

tmpTableCount.setTmpData(tmpTable);

select count(RecId) from tmpTableCount;

recordCount = tmpTableCount.RecId;

info(strfmt(“Total tmpTableCount records = ‘%1’”, recordCount));

}

Not sure if this helps or makes things more confusing!