def execute_multi(self, sql, dtype='namedtuple', limit=None, echo=True, query_name='Record', log=log):
    "\n    Execute multiple SQL statements separtated by ';'. Returns a generator.\n    Example:\n      for fields, rows in conn.execute(sql):\n        print(fields)\n        print(len(rows))\n    "
    self.reconnect(min_tresh=10)
    data = None
    fields = None
    rows = []
    message_mapping = {'drop ': 'Dropping {}.', 'truncate ': 'Truncating {}.', 'select ': 'Selecting {}.', 'create ': 'Creating {}.', 'insert ': 'Inserting {}.', 'alter ': 'Altering {}.', 'update ': 'Updating {}.', 'delete ': 'Deleting {}.', 'exec ': 'Calling Procedure {}.', 'grant ': 'Granting {}.'}
    sqls = sql.split(';')
    for sql in sqls:
        if (not sql.strip()):
            continue
        sql_ = sql.strip().lower()
        for (word, message) in message_mapping.items():
            if sql_.startswith(word):
                if echo:
                    log(message.format(' '.join(sql_.splitlines()[0].split()[1:3]).upper()))
                break
        if sql_.startswith('exec '):
            procedure = sql_[5:].split('(')[0]
            args = sql_[5:].split('(')[1][:(- 1)].replace("'", '').split(',')
            args = [a.strip() for a in args]
            cursor.callproc(procedure, args)
            continue
        try:
            self._fields = []
            rows = self.query(sql, rec_name=query_name, dtype=dtype, limit=limit, echo=echo, log=log)
            fields = self._fields
            if (('-- pk_test:' in sql.lower()) and sql_.startswith('create')):
                sql_lines = sql_.splitlines()
                regexp = 'create\\s+table\\s+(\\S*)[\\sa-zA-Z\\d]+ as'
                table = re.findall(regexp, sql_lines[0])[0]
                line = [l for l in sql_lines if l.strip().lower().startswith('-- pk_test:')][0]
                fields = line.split(':')[(- 1)]
                self.check_pk(table, fields)
        except Exception as E:
            message = get_exception_message().lower()
            if (sql_.startswith('drop ') and (self.error_msg['table_not_exist'] in message)):
                log('WARNING: Table already dropped.')
            else:
                raise E
        if (not fields):
            fields = []
        (yield (fields, rows))
Execute multiple SQL statements separtated by ';'. Returns a generator.
Example:
  for fields, rows in conn.execute(sql):
    print(fields)
    print(len(rows))
def execute_multi(self, sql, dtype='namedtuple', limit=None, echo=True, query_name='Record', log=log):
    "\n    Execute multiple SQL statements separtated by ';'. Returns a generator.\n    Example:\n      for fields, rows in conn.execute(sql):\n        print(fields)\n        print(len(rows))\n    "
    self.reconnect(min_tresh=10)
    data = None
    fields = None
    rows = []
    message_mapping = {'drop ': 'Dropping {}.', 'truncate ': 'Truncating {}.', 'select ': 'Selecting {}.', 'create ': 'Creating {}.', 'insert ': 'Inserting {}.', 'alter ': 'Altering {}.', 'update ': 'Updating {}.', 'delete ': 'Deleting {}.', 'exec ': 'Calling Procedure {}.', 'grant ': 'Granting {}.'}
    sqls = sql.split(';')
    for sql in sqls:
        if (not sql.strip()):
            continue
        sql_ = sql.strip().lower()
        for (word, message) in message_mapping.items():
            if sql_.startswith(word):
                if echo:
                    log(message.format(' '.join(sql_.splitlines()[0].split()[1:3]).upper()))
                break
        if sql_.startswith('exec '):
            procedure = sql_[5:].split('(')[0]
            args = sql_[5:].split('(')[1][:(- 1)].replace("'", ).split(',')
            args = [a.strip() for a in args]
            cursor.callproc(procedure, args)
            continue
        try:
            self._fields = []
            rows = self.query(sql, rec_name=query_name, dtype=dtype, limit=limit, echo=echo, log=log)
            fields = self._fields
            if (('-- pk_test:' in sql.lower()) and sql_.startswith('create')):
                sql_lines = sql_.splitlines()
                regexp = 'create\\s+table\\s+(\\S*)[\\sa-zA-Z\\d]+ as'
                table = re.findall(regexp, sql_lines[0])[0]
                line = [l for l in sql_lines if l.strip().lower().startswith('-- pk_test:')][0]
                fields = line.split(':')[(- 1)]
                self.check_pk(table, fields)
        except Exception as E:
            message = get_exception_message().lower()
            if (sql_.startswith('drop ') and (self.error_msg['table_not_exist'] in message)):
                log('WARNING: Table already dropped.')
            else:
                raise E
        if (not fields):
            fields = []
        (yield (fields, rows))