dnn-3194 Add new SQL functions
updated a number of places where lowercasing was required to match field contents