<pre name="code" class="python"># set default encoding to utf-8
import sys
reload(sys)
sys.setdefaultencoding( "utf-8")
from util.db import db
from util.logger import logger
from sqlalchemy import text
if __name__ == '__main__':
q = text("""
select * from test where id in ( :param )
""")
param1_value = []
rows = db.harbor.execute(q, {'param': "27"}).fetchall()
if rows is not None and len(rows) > 0:
logger.debug("--------%s" % len(rows))
else:
logger.debug("========>>>None")
Python连接数据库查询
最新推荐文章于 2024-01-19 17:20:37 发布