python 连接oracle

python 连接oracleimport cx_Oracle
map1={}
map2={}
con= cx_Oracle.connect("admin/[email protected]")
cursor=con.cursor()
cursor.execute('select *  from test1')
rows = cursor.fetchall()
print rows
for x,y,z,m in rows :
  print x
  print y
  print z
  print m
  map1[x]=y
  key=','.join([str(x),str(y),str(z),str(m)])
  map2[y]=key
print map1
print map2
cursor.close()
con.close()

 

test1表里的数据如下

python 连接oracle

python 连接oracle