I'll suggest this should be a pure function. I do not know what timing overhead of the ODBC getinfo call is. If it takes substantial time, the caching of the return value should be done inside this function.