当前位置:网站首页>pymysql 向MySQL 插入数据无故报错
pymysql 向MySQL 插入数据无故报错
2022-06-24 07:05:00 【YJ语】
一件怪神奇的事情,在使用pymysql向MySQL插入数据的过程中,报以下错误(一些表的插入没有报错!)
pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-支付买家数,粉丝支付买家数,加购商品-支付买家数,引导店铺’ at line 1”)
使用的数据的插入形式如下:
insert into 生意参谋_无线店铺来源数据(日期,流量来源,来源明细,访客数,访客数环比,下单金额,下单金额变化,下单买家数,下单买家数变化,下单转化率,下单转化率变化,支付金额,支付金额变化,支付买家数,支付买家数变化,支付转化率,支付转化率变化,客单价,客单价变化,UV价值,uv价值变化,关注店铺买家数,关注店铺买家数变化,收藏商品买家数,收藏商品买家数变化,加购人数,加购人数变化,新访客,新访客变化,直接支付买家数,收藏商品-支付买家数,粉丝支付买家数,加购商品-支付买家数,引导店铺页访客数,引导店铺页访客数变化) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)
错误猜测:
估计是字段太长导致插入中存在异常
可以使用以下第二种的方式进行数据的插入
# 第一种方式
insert into 表名(字段名1,字段名2,...) values(值1,值2,...);
# 第二种方式:按照表中所有字段进行插入数据,一定要与字段在表中定义的顺序一致
insert into 表名 values(值1,值2,...);
边栏推荐
- ZUCC_ Principles of compiling language and compilation_ Big job
- ZUCC_编译语言原理与编译_实验08 语法分析 LR 分析
- After interviewing and tutoring several children, I found some problems!
- [real estate opening online house selection, WiFi coverage temporary network] 500 people are connected to WiFi at the same time
- jwt(json web token)
- 中国芯片独角兽公司
- String转Base64
- Paper notes: multi label learning dm2l
- 2021-03-16 comp9021 class 9 notes
- Rescue system -- the application of read-write separation
猜你喜欢

Redis的Cluster集群数据倾斜
![[micro services ~nacos] Nacos service providers and service consumers](/img/b7/47ecd6979ccfeb270261681d6130be.png)
[micro services ~nacos] Nacos service providers and service consumers

JUC personal simple notes

Redis cluster data skew

5 minutes, excellent customer service chat handling skills

JUC个人简单笔记

2021-03-11 comp9021 class 8 notes

Permission model DAC ACL RBAC ABAC

2022 tea artist (intermediate) work license question bank and online simulation examination

2022 mobile crane driver special operation certificate examination question bank and online simulation examination
随机推荐
Shell basic operator -- arithmetic operator
ZUCC_ Principles of compiling language and compilation_ Experiment 08 parsing LR parsing
How to configure networkpolicy for nodeport in kubernetes
"Wechat cloud hosting" first practical battle | introduction to minimalist demo
Longhorn installation and use
Three categories of financial assets under the new standards: AMC, fvoci and FVTPL
单目双视三维坐标确定
ZUCC_编译语言原理与编译_实验08 语法分析 LR 分析
Common misconceptions in Tencent conference API - signature error_ code 200003
2021-06-25: a batch of strings consisting only of lowercase letters (a~z) are put
5 minutes, excellent customer service chat handling skills
常用日期格式符与Qt获取当前时间的办法
数据平台简介
ZUCC_编译语言原理与编译_实验04 语言与文法
QTimer定时器不起作用的原因
ZUCC_编译语言原理与编译_实验06 07 语法分析 LL 分析
[acnoi2022] I have done it, but I can't
Xtrabackup for data backup
2021-03-16 comp9021 class 9 notes
小黑ai4code代码baseline啃食1