日期:2014-05-16 浏览次数:20562 次
CREATE OR REPLACE Procedure Test As v_Sn Integer; Begin Select Max(Sn) Into v_Sn From Postcard_Print; For i In (Select Rowid Row_Id From Postcard_Print Where Sn Is Null) Loop v_Sn := v_Sn + 1; Update Postcard_Print Set Sn = v_Sn Where Rowid = i.Row_Id; Commit; End Loop; Commit; End;
?说明:
?????? Postcard_Print为需要加入序列的表名;
?????? v_Sn为设置的累加变量;
?????? Sn为序列的字段;