adodataset1.Close;
adodataset1.CommandText:='select * from tb_emp_task where busi='''+s+''' '+
' and is null and emp_id is null and rownum='+inttostr(1);
adodataset1.Open;
if not adodataset1.IsEmpty then
begin
try
u_dm.DataModule1.ADOConnection1.BeginTrans;
adoquery1.Close;
adoquery1.SQL.Clear;
str_sql:='update tb_emp_task set emp_id='''+u_logon.str_emp_id+''' where '+
' busi='''+s+''' and is null and phone='''+adodataset1['phone']+''' ';
adoquery1.SQL.Add(str_sql);
adoquery1.ExecSQL;
u_dm.DataModule1.ADOConnection1.CommitTrans;
except
u_dm.DataModule1.ADOConnection1.RollbackTrans;
application.MessageBox('ADOQUERY控件更新出错!更新失败!','警告')
end;
end
else
begin
application.MessageBox('没有资料了','提示');
exit;
end;
我在程序中使用ORACLE事务提取资料,怎么每天老是存在两三个数据被两个人都获得,我认为这样应该可以呀,当一个人提一条记录时,ORACLE事务应该把这条记录锁定啊,怎么还会被另外的人得到,大家有没有好的解决方法,在线等待,有好方法马上给分,谢谢........
adodataset1.CommandText:='select * from tb_emp_task where busi='''+s+''' '+
' and is null and emp_id is null and rownum='+inttostr(1);
adodataset1.Open;
if not adodataset1.IsEmpty then
begin
try
u_dm.DataModule1.ADOConnection1.BeginTrans;
adoquery1.Close;
adoquery1.SQL.Clear;
str_sql:='update tb_emp_task set emp_id='''+u_logon.str_emp_id+''' where '+
' busi='''+s+''' and is null and phone='''+adodataset1['phone']+''' ';
adoquery1.SQL.Add(str_sql);
adoquery1.ExecSQL;
u_dm.DataModule1.ADOConnection1.CommitTrans;
except
u_dm.DataModule1.ADOConnection1.RollbackTrans;
application.MessageBox('ADOQUERY控件更新出错!更新失败!','警告')
end;
end
else
begin
application.MessageBox('没有资料了','提示');
exit;
end;
我在程序中使用ORACLE事务提取资料,怎么每天老是存在两三个数据被两个人都获得,我认为这样应该可以呀,当一个人提一条记录时,ORACLE事务应该把这条记录锁定啊,怎么还会被另外的人得到,大家有没有好的解决方法,在线等待,有好方法马上给分,谢谢........
解决方案 »
- delphi chart控件有的机器上能显示 但在有的机器上就不能显示
- 【討論,討論】Delphi (Object Pascal), C# 和 .Net(Dot Net) 分別和優點在哪?
- 兄弟们,顶一把嘛:
- 请高提供一个可以将wav转换成mp3格式的的DLL连接库呗,最好能附上函数使用格式.谢了!
- 用delphi和com构建三层构架??
- 关于ListView的几个问题?
- 求解安装 sqldmo 时的错误
- 在FastReport报表里的Picture中,如何动态加入图片?
- 摩托~~~:midas板块人气太差,希望大家常来看看!给大家点东西,进来看看,有没有兴趣!(高手就算了,呵呵)
- 关于判断字段存在的问题
- 难道是“动态数组空间分配”出现错误?请指教
- 怎样取得一个字体的所有字号?
adodataset1.Close;
adodataset1.CommandText:='select * from tb_emp_task where busi='''+s+''' '+
' and is null and emp_id is null and rownum='+inttostr(1) + ' for update';
u_dm.DataModule1.ADOConnection1.BeginTrans;
try
adodataset1.Open;
if not adodataset1.IsEmpty then
...
luckzhangs(飞) 这位兄弟能不能给出确定的答复,再说ADOConnection1.IsolationLevel 的级别那么多,到底用哪一个呀,大家不要吝啬自己的方法,给俺说一下吧,我会马上给分的,谢谢.....