def merge_table(self,name):
"""Merge an existing table in the database with the __self__ table.
n = a.merge_table(<name>)
Executes as 'INSERT INTO __self__ SELECT * FROM <name>'.
However, this method is probably used less often than the simpler merge(recarray).
:Arguments:
name name of the table in the database (must be compatible with __self__)
:Returns:
n number of inserted rows
"""
l_before = len(self)
SQL = """INSERT OR ABORT INTO __self__ SELECT * FROM %s""" % name
self.sql(SQL)
l_after = len(self)
return l_after - l_before
评论列表
文章目录