当前位置:网站首页>Pymssql controls SQL for Chinese queries
Pymssql controls SQL for Chinese queries
2022-07-03 09:56:00 【CSDN Q & A】
The phenomenon and background of the problem
pymssql control SQL The result cannot be found during Chinese query , however SQL Statements in SSMS Results can be found in


Problem related code , Do not paste screenshots
import SQL_part
if name == 'main':
con,cur=SQL_part.ConDataBase()
print(SQL_part.Select_Plate(cur,' Wan A4K1PS'))

Test functions
def Select_Plate(cursor,plate):
sql = "SELECT * FROM LicensePlate where plate='%s'"%plate
cursor.execute(sql.encode('cp936'))
return cursor.fetchall()
Query function
SQL sentence
SELECT * FROM LicensePlate where plate=' Wan C45K23'
Operation results and error reporting contents
No error reported , But there was no expected result
My solution ideas and tried methods
Consider maybe SQL Coding Chinese problems , But another query function can get results normally , And in ssms in sql Statements can be run
What I want to achieve
Can get Chinese keyword query results
Take the answer :
Probability is a matter of character set , Please confirm the consistency of file code and character set .
in addition , Try to put cp936 Switch to cp65001, The one in front is ansi(GBK), The back is utf8
边栏推荐
- STM32 serial port usart1 routine
- SCM is now overwhelming, a wide variety, so that developers are overwhelmed
- Education is a pass and ticket. With it, you can step into a higher-level environment
- 当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
- C language enumeration type
- SSB Introduction (PbCH and DMRs need to be supplemented)
- Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
- Windows下MySQL的安装和删除
- JMX、MBean、MXBean、MBeanServer 入门
- Successful graduation [2] - student health management system function development...
猜你喜欢

Convert IP address to int

Electronic product design, MCU development, circuit cloning

Design and development of biological instruments

Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~

There is no specific definition of embedded system

Stm32-hal library learning, using cubemx to generate program framework

Electronic product design

新系列单片机还延续了STM32产品家族的低电压和节能两大优势
![Successful graduation [3]- blog system update...](/img/91/72cdea3eb3f61315595330d2c9016d.png)
Successful graduation [3]- blog system update...

嵌入式系统没有特别明确的定义
随机推荐
嵌入式系统没有特别明确的定义
Project cost management__ Cost management technology__ Article 6 prediction
MySQL的简单使用(增删改查)
UCI and data multiplexing are transmitted on Pusch - determine the bit number of harqack, csi1 and csi2 (Part II)
SCM is now overwhelming, a wide variety, so that developers are overwhelmed
Synchronization control between tasks
Gpiof6, 7, 8 configuration
The third paper of information system project manager in soft examination
单片机学到什么程度能找到工作,这个标准不好量化
[Li Kou brush question notes (II)] special skills, module breakthroughs, classification and summary of 45 classic questions, and refinement in continuous consolidation
Learn the contents of 5g toolbox supporting NR through the NR resources provided by MATLAB
Windows下MySQL的安装和删除
Install local sources using yum
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己
没有多少人能够最终把自己的兴趣带到大学毕业上
单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇
NR PUCCH format0 sequence generation and detection mechanism
顺利毕业[3]-博客系统 更新中。。。
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip