您的位置:首页 > 博客中心 > 数据库 >

oracle python

时间:2022-03-14 02:27

#!/usr/bin/python

import csv

import cx_Oracle

tns_name = cx_Oracle.makedsn(‘192.168.1.230‘,‘1521‘,‘hfpboc‘)

db = cx_Oracle.connect(‘hfpboc‘,‘hfpboc‘,tns_name)

cursor = db.cursor()

f = open("cardacc.csv","w")

writer = csv.writer(f,lineterminator="\n",quoting=csv.QUOTE_NONNUMERIC)

r = cursor.execute("SELECT * FROM t_inf_card_act")

for row in cursor:

    writer.writerow(row)

f.close()


热门排行

今日推荐

热门手游