CREATE OR REPLACE PROCEDURE ChangePop (cc VARCHAR2, pop IN OUT NUMBER, dens OUT NUMBER)
IS
  temp number;
  BEGIN
  SELECT population INTO temp FROM country WHERE code = cc;
  UPDATE country SET population = pop WHERE code = cc;
  SELECT population/area INTO dens FROM country WHERE code = cc;
  pop := temp;
END;
/
DECLARE pop NUMBER; dens NUMBER;
BEGIN
  pop := 80000000;
  ChangePop('D', pop, dens);
  dbms_output.put_line(pop);     -- 82521653 the before pop
  dbms_output.put_line(dens);    -- 226.94   new density
END;
/
