python脚本批量生成50000条插入数据的sql语句
时间:2021-07-01 10:21:17
帮助过:4人阅读
f = open(
"xx.txt",
‘w‘)
2 for i
in range(1,50001
):
3 str_i =
str(i)
4 realname =
"lxs"+
str_i
5 phone = 13678101715 +
i
6 email =
"lxs" + str_i +
"@126.com"
7 sql =
‘insert into table_a (realname,phone,email,sign,event_id) values ("‘+realname+
‘",‘ +str(phone)+
‘,"‘+email+
‘",0,1);‘
8 f.write(sql)
9 f.write(
"\n")
10 print(
‘50000 success!‘)
11 f.close()
python脚本批量生成50000条插入数据的sql语句
标签:class val 插入 sign name into open insert 语句