Let us say, we have the following table my_table:
id Col1 Col2
1 some data some data
2 some data some data
3 some data some data
4 some data some data
Additionally let us assume that there is an update process of the table and after its execution the table ends up with lower number of rows.
We want to iterate this process until "my_table" has no rows. It is certain that after a finite number of iterations of the update process, the table has zero rows.
How correct is to try sth like this:
while (select count(id) from my_table) != 0 loop
update process
...;
end loop;