zl程序教程

您现在的位置是:首页 >  Python

当前栏目

Python 技术篇-操作oracle数据库执行SQL语句报错,提示ORA-00911: 无效字符解决方法

2023-03-20 15:33:14 时间

cursor.execute("select name from v

import cx_Oracle as cx

con = cx.connect('ncc2020_0609', 'sys', '10.10.xx.xx:1521/orcl')   # 创建连接
cursor = con.cursor()   # 创建游标
cursor.execute("select name from v$datafile;")   # 执行sql语句
for i in cursor:   # 打印数据
    print(i)
cursor.close()   # 关闭游标
con.close()   # 关闭数据库连接

报错信息:

修改后运行效果图:

喜欢的点个赞❤吧!