当前位置:网站首页>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
边栏推荐
- [CSDN] C1 training problem analysis_ Part IV_ Advanced web
- JS基础-原型原型链和宏任务/微任务/事件机制
- 单片机学到什么程度能找到工作,这个标准不好量化
- I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first
- The cyclic shift of PUCCH in NR channel is generated by MATLAB
- 【男保姆式】教你打开第一个微信小程序
- PRACH --- originator
- 要选择那种语言为单片机编写程序呢
- Install local sources using yum
- Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
猜你喜欢

单片机学到什么程度能找到工作,这个标准不好量化

How does the nr-prach receiver detect the relationship between prembleid and Ta

Development of fire power monitoring system

Design and development of biological instruments

Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?

In third tier cities and counties, it is difficult to get 10K after graduation

学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里

Electronic product design
![[CSDN] C1 training problem analysis_ Part II_ Web Foundation](/img/91/72cdea3eb3f61315595330d2c9016d.png)
[CSDN] C1 training problem analysis_ Part II_ Web Foundation

Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
随机推荐
要選擇那種語言為單片機編寫程序呢
Eight working modes of stm32gpio and chip naming rules
STM32 serial port usart1 routine
MYSQL数据库底层基础专栏
Design and development of biological instruments
[graduation successful] [1] - tour [Student Management Information System]
2021-09-26
Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from
[combinatorics] Introduction to Combinatorics (combinatorial thought 2: mathematical induction | mathematical induction promotion | multiple induction thought)
顺利毕业[3]-博客系统 更新中。。。
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
端午节快乐!—— canvas写的粽子~~~~~
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
Development of electrical fire system
Fundamentals of Electronic Technology (III)_ Integrated operational amplifier and its application__ Basic arithmetic circuit
JS基础-原型原型链和宏任务/微任务/事件机制
Process communication - semaphore
Synchronization control between tasks
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
GPIO port details, Hal library operation keys