code: def execute_favorite_query(cur, arg, **_):
      
      if arg == '':
          for result in list_favorite_queries():
              yield result
  
      """Parse out favorite name and optional substitution parameters"""
      name, _, arg_str = arg.partition(' ')
      args = shlex.split(arg_str)
  
      query = favoritequeries.get(name)
      if query is None:
          message = "No favorite query: %s" % (name)
          yield (None, None, None, message)
      else:
          query, arg_error = subst_favorite_query_args(query, args)
          if arg_error:
              yield (None, None, None, arg_error)
          else:
              for sql in sqlparse.split(query):
                  _logger.debug("query is [%s]", sql)
                  sql = sql.rstrip(';')
                  title = '> %s' % (sql)
                  cur.execute(sql)
                  if cur.description:
                      headers = [x[0] for x in cur.description]
                      yield (title, cur.fetchall(), headers, None)
                  else:
                      yield (title, None, None, None)
docs: Returns (title, rows, headers, status)