Declare
hh dlyx.y_khda.hh%Type;
s Number :=0;
Begin
For m In (Select * From tmhb070101 t)
Loop
Select Count(*)
Into s
From dlyx.y_khda@yjdlyx k Where
substr(k.yhh,1,length(k.yhh)-3)=m.yhh And k.dw Like '0303%';
dbms_output.put_line(s);
If s = 1 Then
Select k.hh
Into hh
From dlyx.y_khda@yjdlyx k Where
substr(k.yhh,1,length(k.yhh)-3)=m.yhh;
dbms_output.put_line(hh);
Update tmhb070101 tm
Set tm.hh = hh
Where tm.yhh = m.yhh;
End If;
End Loop;
Commit;
--Select * From tmhb070101;
End;
我执行了这段程序之后,为什么tmhb070101这张表里的hh这个字段仍然没有更新过来。
hh dlyx.y_khda.hh%Type;
s Number :=0;
Begin
For m In (Select * From tmhb070101 t)
Loop
Select Count(*)
Into s
From dlyx.y_khda@yjdlyx k Where
substr(k.yhh,1,length(k.yhh)-3)=m.yhh And k.dw Like '0303%';
dbms_output.put_line(s);
If s = 1 Then
Select k.hh
Into hh
From dlyx.y_khda@yjdlyx k Where
substr(k.yhh,1,length(k.yhh)-3)=m.yhh;
dbms_output.put_line(hh);
Update tmhb070101 tm
Set tm.hh = hh
Where tm.yhh = m.yhh;
End If;
End Loop;
Commit;
--Select * From tmhb070101;
End;
我执行了这段程序之后,为什么tmhb070101这张表里的hh这个字段仍然没有更新过来。
substr(k.yhh,1,length(k.yhh)-3)=m.yhh And k.dw Like '0303%'执行一下,你好象是访问另外一个数据库里的表,m是什么??
一步步检查才能找到原因。@yjdlyx 这是dblink吗?访问的是远程数据库啊?
一步步检查才能找到原因。
--查过了,有成立的机会,
@yjdlyx 这是dblink吗?访问的是远程数据库啊?
--是的