U_Monitor_SqlEXEC_01
用例编号
U_ Monitor_SqlEXEC_01
用例名称 SQL 语句执行函数
功能描述 用于 SQL 运行语句的执行。
预置条件 无
例外情况 无
测试步骤
(方法)
编写测试代码,使用 DUNIT 测试工具进行测试。
procedure sqlexec(qry: TADOQuery; querystr: string);
begin
with qry do
begin
close;
SQL.clear;
SQL.Add(querystr);
try
ExecSQL;
except
end;
end;
end;
procedure sqlexec _test()
{
sqlexec (q1,’ delete from coal where coalid=’3527022’’);
sqlexec (q1,’ select * from coal where coalid=’3527022’’);
sqlexec (q1,’ select * from coal where coalid=’35270’’);
}
期望结果
1. 数据库中煤矿编号为 3527022 的煤矿被删除。
2. 输出数据库中煤矿编号为 3527022 的煤矿的所有信息。
3. 提示错误信息。
评论10