在python中使用simple_salesforce包来摄取Account时,出现以下与collections.OrderedDict', 'HY105'相关的错误

问题描述

您好,感谢您花时间阅读本文。几天来,我一直在弄清楚为什么当我尝试将帐户数据加载到 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)

此 Account 表中有 94 列吗?

谢谢你和我一起思考

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)