您好,感谢您抽出宝贵时间阅读本文。几天来,当我尝试将帐户数据加载到 mssql 数据库时,我一直在弄清楚为什么会出现此错误。连接很好。
但我不断收到这些错误:
(pyodbc.ProgrammingError) ('Invalid parameter type. param-index=17 param-type=collections.OrderedDict', 'HY105')
Exception: (102, b"Incorrect syntax near 'Id'.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")
Exception: One or more values in the dataframe have more characters than possible in the database table. The maximum number of characters in each column are:
如何规避这些错误并正确加载数据:
我用这个例如:
engine = sal.create_engine('mssql+pyodbc:///?odbc_connect={}'.format(params))
conn = engine.connect()
for entity in ['Account']:
df = get_salesforce_data(sf=sf, sf_object=entity, method=method)
df.to_sql(entity, con = engine, if_exists ='append', index = False, chunksize = 1000)
此帐户表中有 94 列?
谢谢你和我一起思考