为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:8
【操作系统】:麒麟V10
【CPU】:
【问题描述】*:
python3中通过cursor.executemany(sql, values)插入数据报错 TypeError: buffer type error!
关键在于在开发电脑本地调用是通过了的,数据也正常入库了,而在服务器上调用同样的代码就报buffer type error
服务器和本地包版本一致为:
aioredis 1.3.1
APScheduler 3.9.1
async-timeout 4.0.3
backports.zoneinfo 0.2.1
bcrypt 3.2.0
bitarray 2.4.1
certifi 2021.10.8
cffi 1.15.0
chardet 3.0.4
click 8.1.2
cryptography 36.0.2
dataclasses 0.6
DBUtils 3.0.2
decorator 5.1.1
demjson 2.2.4
dmPython 2.5.5
docopt 0.6.2
et-xmlfile 1.1.0
fastapi-cache 0.1.0
Flask 2.0.2
future 0.18.2
gevent 21.12.0
greenlet 1.1.2
gssapi 1.7.3
hdfs 2.7.0
hiredis 2.3.2
idna 2.10
importlib-metadata 4.11.3
importlib-resources 5.3.0
impyla 0.17.0
itsdangerous 2.1.2
jdcal 1.4.1
Jinja2 3.1.1
joblib 1.1.0
kerberos 1.3.1
kmodes 0.11.1
krbcontext 0.9
lxml 4.5.1
MarkupSafe 2.1.1
numpy 1.21.6
openpyxl 3.0.4
pandas 1.3.5
pandasql3 0.7.3
paramiko 2.7.2
pip 22.0.4
ply 3.11
pure-sasl 0.6.2
py4j 0.10.7
pyapollo 0.0.1.dev1
pycparser 2.21
PyHive 0.6.1
pymssql 2.2.4
PyMySQL 1.0.2
PyNaCl 1.5.0
pyspnego 0.5.2
python-dateutil 2.8.2
python-docx-1 0.0.2
pytz 2022.1
pytz-deprecation-shim 0.1.0.post0
pyzmq 23.1.0
requests 2.23.0
requests-kerberos 0.14.0
scikit-learn 1.0.2
scipy 1.7.3
setuptools 47.1.0
six 1.16.0
SQLAlchemy 1.4.35
sqlalchemy-dm 1.1.10
sqldf 0.4.2
threadpoolctl 3.1.0
thrift 0.11.0
thrift-sasl 0.4.3
thriftpy2 0.4.14
typing-extensions 3.10.0.0
tzdata 2022.1
tzlocal 4.2
urllib3 1.25.11
Werkzeug 2.1.1
xmltodict 0.13.0
zipp 3.8.0
zope.event 4.5.0
zope.interface 5.4.0
-- 对应的sql插入语句及values数据如下
INSERT INTO qp_workflow_session_context_ex (Category, SPId, SPCode, SPRItemCode, TBId, ItemId, ItemCode, ItemValue, SessionId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
-- [['TrustItem', '0', '', '', '0', '0', 'TrustCode', 'testljt', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustItem', '0', '', '', '0', '0', 'TrustName', 'testljt', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustItem', '0', '', '', '0', '0', 'OrganisationName', 'CIB', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustItem', '0', '', '', '0', '0', 'IsTopUpAvailable', '1', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustItem', '0', '', '', '0', '0', 'IssueAmount', '11.11', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustItem', '0', '', '', '0', '0', 'TrustNameShort', 'testljt', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'ExchangeCenter', 'InterBankMarket', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'BasicAssetsType', 'RMBS', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'PublishMethod', '公募', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'Regulators', '银保监', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'BaseAssetPoolBalance', '11.11', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'EstablishmentDatePoolBalance', '11.11', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'SpecialPlanState', '1', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', ' SettlementCenter', 'ChinaBond', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'ShareBenefitMode', 'PoolCloseDate', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'PoolCloseProperty', 'PMR_NO', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'Consideration', '11', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'DiscountPriceRate', '11', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'PrincipalStartDate', 'BusinessDate', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'InterestStartDate', 'BusinessDate', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'AccountingTreatment', '完全表内', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', '', '', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'CiAmount', '0', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566'], ['TrustInfoExtensionItem', '0', '', '', '0', '0', 'RiskRewardTransfer', '0', '3f55bbe2-f7d1-11ee-b3f0-0871906a1566']]
附上该表的DDL:
CREATE TABLE "QP"."QP_WORKFLOW_SESSION_CONTEXT_EX"
(
"SESSIONCONTEXTID" BIGINT IDENTITY(107137, 1) NOT NULL,
"SESSIONID" VARCHAR(64),
"CATEGORY" VARCHAR(100),
"SPID" INT,
"SPCODE" VARCHAR(255),
"SPRITEMCODE" VARCHAR(100),
"ITEMID" BIGINT,
"ITEMCODE" VARCHAR(255),
"ITEMVALUE" CLOB,
"TBID" INT,
NOT CLUSTER PRIMARY KEY("SESSIONCONTEXTID")) STORAGE(ON "MAIN", CLUSTERBTR) ;
请问您有找到好的解决办法吗,目前也碰到这种情况,windows不报错,linux服务器上就报错了,只能改回用execute一行一行插入,太慢了。。。
能提供完整堆栈嘛