艺赛旗 RPA9.0全新首发免费下载 点击下载
http://www.i-search.com.cn/index.html?from=line1
oracle 篇 1 - 查询数据
代码
#!/usr/bin/env Python3
-- coding: utf-8 --
@Software: PyCharm
@virtualenv:workon
@contact: contact information
@Desc:Code descripton
author = ‘未昔/AngelFate’
date = ‘2019/8/29 22:05’
import cx_Oracle
#连接数据库
db = cx_Oracle.connect(‘root/123456@localhost/novel’)
cursor = db.cursor()
cursor.execute (“SELECT * FROM novel”)
rows = cursor.fetchall() #得到所有数据集
for row in rows:
print("%d, %s, %s, %s" % (row[0], row[1], row[2], row[3]))
cursor.close ()
db.close()
最新 优选 关注 数据统计