可能是我被打动的简单事物
以下代码在python 3.6中引发错误:
curs.execute (sql_command)
cx_oracle.DatabaseError: ORA-24373: invalid length specified for statement.
代码:
import cx_oracle
conn = cx_oracle.connect(xx/xx@xx)
curs = conn.cursor()
curs.arraysize=100
f = open('C:/query.sql')
file_read = f.read()
f.close()
sql_split = file_read.split(';')
for sql_command in sql_split:
curs.execute (sql_command)
results = curs.fetchall()
for row in results:
print(''.join(row))
curs.close
conn.close