#!/usr/bin/pythonpython
import csvit
import cx_Oracleimport
tns_name = cx_Oracle.makedsn('192.168.1.230','1521','hfpboc')csv
db = cx_Oracle.connect('hfpboc','hfpboc',tns_name)im
cursor = db.cursor()db
f = open("cardacc.csv","w")make
writer = csv.writer(f,lineterminator="\n",quoting=csv.QUOTE_NONNUMERIC)co
r = cursor.execute("SELECT * FROM t_inf_card_act")connect
for row in cursor:
writer.writerow(row)
f.close()