oracle8.1.6
begin
portal.delete(portal_id => :portal_id);
end;
update portal_elements
set region = :region,
page_id = :page_id,
sort_key = (select nvl((select max(sort_key) + 1
from portal_elements
where page_id = :page_id
and region = :region),
1)
from dual)
where element_id = :element_id