Are you talking about initializing on first occasion, something like this
```c++
if (mTrackLocationIdColumn!=-2) // is not set before
    mTrackLocationIdColumn = m_pQueryTrackLocationSelect->record().indexOf("id");
```