DB2中的ROWID和游标
Ricky
posted @ 2014年5月09日 10:18
in Other
, 2634 阅读
DB2的RID对于分区表同样是唯一值:
Declare c1 cursor with hold for
Select
Pk,
Value, RID(t)
Into
:Va,
:Vb
from tbname t
Order by Pk
For fetch only
fetch pk,value, my-rid
Update:
Set
Value = :Vb
Where
RID(t) = my-rid
If the row is not the same row as fetched it will give you a +100