Stringify uid when constructing a SQL statement