当前位置:Gxlcms > 数据库问题 > python -- 连接 orclae cx_Oracle的使用

python -- 连接 orclae cx_Oracle的使用

时间:2021-07-01 10:21:17 帮助过:4人阅读

=cx_Oracle.connect(oa/oa@192.168.0.70:1521/ekp) #连接数据库 cursor = conn.cursor () try: # 解析sql语句 # cursor.parse("select * dual") pass # 捕获SQL异常 except cx_Oracle.DatabaseError as e: print(e) # ORA-00923: 未找到要求的 FROM 关键字 # 执行sql 语句 cursor.execute ("select * from EKP_PRODUCTIVITY_SL") for row in cursor: print(row) c.close() #关闭cursor conn.close()

 

python -- 连接 orclae cx_Oracle的使用

标签:database   oracl   sele   连接数   select   关闭   style   执行   数据   

人气教程排行