当前位置:网站首页>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,...);
边栏推荐
- Opencv实现图像的基本变换
- 2021-06-25: a batch of strings consisting only of lowercase letters (a~z) are put
- 2021-06-24: find the length of the longest non repeating character substring in a string.
- [real estate opening online house selection, WiFi coverage temporary network] 500 people are connected to WiFi at the same time
- Fundamentals of 3D mathematics [17] inverse square theorem
- QTimer定时器不起作用的原因
- Export MySQL database to xxx SQL, set xxx The SQL file is imported into MySQL on the server. Project deployment.
- JUC personal simple notes
- Several ways you can't move zero (sequel)
- 数据库,查询本月借出书的数量,如果高于10本时,显示“本月借出书大于10本”,否则显示“本月借出书小于10本”
猜你喜欢

新技术实战,一步步用Activity Results API封装权限申请库

5分钟,客服聊天处理技巧,炉火纯青
![[explain the difference between operation and maintenance and network engineering]](/img/2b/945f468588e729336e2e973e777623.jpg)
[explain the difference between operation and maintenance and network engineering]

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

什么是SRE?一文详解SRE运维体系

Vscode install the remote -wsl plug-in to connect to the local WSL

Longhorn installation and use

jwt(json web token)

ZUCC_ Principles of compiling language and compilation_ Experiment 04 language and grammar

一文详解|增长那些事儿
随机推荐
QT writing security video monitoring system 36 onvif continuous movement
2021-06-25: a batch of strings consisting only of lowercase letters (a~z) are put
[acnoi2022] not a structure, more like a structure
Shell basic operators -- relational operators
Rust procedure macro simply imitates Lombok function
Opencv get (propid) common values
成为IEEE学生会员
PHP代码加密+扩展解密实战
2021-03-16 comp9021 class 9 notes
Common date formatter and QT method for obtaining current time
单目双视三维坐标确定
Xtrabackup for data backup
Shell basic operator -- arithmetic operator
JS merge multiple objects and remove duplicates
Promise usage scenarios
Blue screen error UNMOUNTABLE boot volume of the solution
PHP code encryption + extended decryption practice
05 Ubuntu installing mysql8
There was an error checking the latest version of pip
How to handle the problem that calling easycvr address integration cannot be played through easyplayer player?