python TypeError: unsupported operand type(s) for +: 'int' and 'str' [closed]

时间:2022-09-10 21:54:27

TypeError: unsupported operand type(s) for +: 'int' and 'str' [closed]

 

sql="insert into auto_transfer_data(atd_type,atd_mogodb_count,atd_mysql_before_count,atd_create_date)values('"+at_type+"','"+str(mongodbcount)+"','"+str(mysql_before_count)+"','"+currentDate+"')"

解决办法 类型转换
int转成string,函数str(number)
string转成int,函数int(string)