python脚本批量生成50000条插入数据的sql语句

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python脚本批量生成50000条插入数据的sql语句相关的知识,希望对你有一定的参考价值。

 1 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语句的主要内容,如果未能解决你的问题,请参考以下文章