Cast db value to string before comparison