当前位置:网站首页>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
边栏推荐
- Project scope management__ Scope management plan and scope specification
- How does the nr-prach receiver detect the relationship between prembleid and Ta
- Install local sources using yum
- [combinatorics] Introduction to Combinatorics (context of combinatorics | skills of combinatorics | thought of combinatorics 1: one-to-one correspondence)
- MySQL的简单使用(增删改查)
- STM32 interrupt switch
- Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from
- The cyclic shift of PUCCH in NR channel is generated by MATLAB
- Of course, the most widely used 8-bit single chip microcomputer is also the single chip microcomputer that beginners are most easy to learn
- Introduction to chromium embedded framework (CEF)
猜你喜欢
Hal library sets STM32 clock
Characteristics of PUCCH formats
Intelligent home design and development
Notes on C language learning of migrant workers majoring in electronic information engineering
顺利毕业[2]-学生健康管理系统 功能开发中。。。
万字手撕七大排序(代码+动图演示)
Definition and use of enum in C language
Of course, the most widely used 8-bit single chip microcomputer is also the single chip microcomputer that beginners are most easy to learn
The third paper of information system project manager in soft examination
开学实验里要用到mysql,忘记基本的select语句怎么玩啦?补救来啦~
随机推荐
el-table X轴方向(横向)滚动条默认滑到右边
The new series of MCU also continues the two advantages of STM32 product family: low voltage and energy saving
NR technology -- MIMO
对于新入行的同学,如果你完全没有接触单片机,建议51单片机入门
学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
Nr-prach: access scenario and access process
Uniapp realizes global sharing of wechat applet and custom sharing button style
端午节快乐!—— canvas写的粽子~~~~~
Stm32f04 clock configuration
Hal library sets STM32 clock
Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
An executable binary file contains more than machine instructions
[untitled] proteus simulation of traffic lights based on 89C51 Single Chip Microcomputer
There is no specific definition of embedded system
Process communication - semaphore
Nr-prach:prach format and time-frequency domain
Electronic product design, MCU development, circuit cloning
STM32 interrupt switch
STM32 general timer output PWM control steering gear
[22 graduation season] I'm a graduate yo~