dcsxlh

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
统计
 

 

 

 

 

 

一、安装库

1、查看数据库是否按安装

1.1 DatabaseLibrary

 

 

pip3 install mysqlclient-2.0.1-cp37-cp37m-win_amd64.whl

dos  下安装

 

 

 

 

 

 

 

导入DatabaseLibrary库

 

 

 

 

 

 

 

 

 

创建库,

 

 

关键字:

1、connect to database  #连接数据库的配置信息

connect to database pymysql dcs root 123456 192.168.153.131 3306

 

 

 

 

 

 2、table must exist

table must exist test # 判断表存在 #有则ok没有则NO

2。1不存在的表,报错

 

 2.2存在的表,运行成功

 

 

 

 

 

3、Check If Exists In Database

3.1判断数据库中已经存在的数据

 

 

 

 

 

 3.2 判断数据库中不存存在的数据

 

 

 

 

 

4、check if not exists in database

4.1

 

 

 

 4.2

 

 

 

 

5\ Delete All Rows From Table 删除表中所有数据

 

 Delete All Rows From Table sc #删除表中所有数据 Disconnect From Database

 

 

 

 6\Execute Sql Script D:\sql.txt #执行脚本

 

 

 

 

 

 

 

 

 

 

 

6、Execute Sql String #执行sql语句

Execute Sql String insert  into test values (12,23); #执行sql语句

 

 

 

 

7、Query

${vael} Query select * from test
log ${vael} #查询当前表中所有的数据

 

 

 

 

8、ROW COUNT

 

 

${count} ROW COUNT select * from test
log ${count} #统计当前数据库中的行数

 

 

 9. ROW COUNT IS 0   #判断当前数据库中没有的数据

 

 

ROW COUNT IS 0
select * from s ; #判断当前数据库中没有的数据

 

 

 

 

10、ROW COUNT IS equal to x  #行数等于 多少行

 

 10.1

ROW COUNT IS equal to x select *  from test 13 #行数等于10

 

 10.2

 

 

ROW COUNT IS equal to x select *  from test 10 #行数等于10

 

 11. Row Count Is Greater Than X  #行数大于多少行

 

 

 Row Count Is Greater Than X select *  from test 11 #行数大于11 `

 

 

 

10.2

 

 

 

11.Row Count Is Less Than X  # #行数小于

 

 

Row Count Is Less Than X

select * from test; 20 #行数小于20

 

 

 

 

 

Row Count Is Less Than X
select * from test; 9 #行数小于20

 

 

 

 

11、 Disconnect From Database #断开数据库连接 #断开数据库连接

 

 Disconnect From Database #断开数据库连接 #断开数据库连接

 

posted on   多测师_肖sir  阅读(349)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
 
点击右上角即可分享
微信分享提示