implement sql function, create Validater