update sql sintax on functions