Я пытаюсь зациклить все свои записи из таблицы A и для половины настройки записей для столбца A = 1 и для второй половины записей столбца A = 2.
declare
Type T2 Is Table Of TableA%Rowtype Index By Binary_Integer;
V2 T2;
Type T3 Is Table Of TableA%Rowtype Index By Binary_Integer;
V3 T3;
Maxrow Number(10);
mHalf Number(10);
begin
Select round(Max(Rownum)/2) Into Maxrow From TableA;
Select * Bulk Collect Into V2 From TableA Where Rownum < Mhalf;
Select * Bulk Collect Into V3 From TableA Where Rownum >= Mhalf;
For I In 1..2 Loop
If I=1 Then
For Z In V2.First..V2.Last Loop
update tableA set columnA = 1 where Rownum = V2(Z);
End Loop;
Elsif I=2 Then
For ZZ In V3.First..V3.Last Loop
update tableA set columnA = 2 where Rownum = V3(ZZ);
End Loop;
End if;
End Loop;
end;
Но что-то идет не так,Когда я проверяю:
Select Count(*) From tableA Where Rownum > 300;
здесь я не получаю никаких записей