# -*- coding: utf-8 -*-
"""
Created on Tue Jul 10 22:06:43 2018
使用 executemany 方法,插入值保存在 list 中
@author: User
"""
import fdb
con = fdb.connect(host='127.0.0.1',database='D:/0tixiao/A1.FDB', user='sysdba', password='masterkey',charset='UTF8')
cur = con.cursor()
sql_select = 'select * from T1 order by year_released'
cur.execute(sql_select)
print(cur.fetchall())
cur.close()
con.close()
显示结果:
[('Lisp', 1958), ('c', 1972), ('Python', 1991), ('Dylan', 1995)]