""" Executes a query and returns a list of rows.
"execute_params" can be a dict of values, that can be referenced
in the SQL statement using "%(key)s" or, in the case of Oracle,
":key".
Example:
query = "SELECT * FROM mytable WHERE city = %(city)s AND
date > %(dt)s"
execute_params = {
'city': 'Lisbon',
'dt': datetime.datetime(2000, 12, 31),
}
If metadata=True, it will instead return a dict containing the
rows list and the columns list, in the format:
{ 'cols': [ 'col_a', 'col_b', ...]
, 'rows': [ (a0, b0, ...), (a1, b1, ...), ...] }
"""
在使用该模块链接第三方数据库时,sql语句%好应该添加在传入参数的部分。
xx.execute_mssql(sql, {'FNo': '%'+search_str+'%'}, False)