尝试^
使用 python 2.4.3 将分隔文件导入 DB2 数据库时出现以下错误。
错误:
Traceback (most recent call last): File "C:\Python25\Usefulscripts\order.py", line 89, in <module> load_order_stack() File "C:\Python25\Usefulscripts\order.py", line 75, in load_order_stack conn2.execute(importTmp) ProgrammingError: ('42601', '[42601] [IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "orders_extract"
在“import from”之后发现。
代码:
import pyodbc
def load_order_stack():
try:
conn2 = pyodbc.connect('DSN=db2Database;UID=ueserid;PWD=password')
importTmp = ("import from orders_extract of del modified by coldel0x5E"
"insert_update into test.ORDERS_Table (ORDER_ID,item,price);")
conn2.execute(importTmp)
conn2.commit()