added substitution to sql visitor