CREATE OR REPLACE PROCEDURE getcitiesCursor (ccode country.code%TYPE)
IS
  TYPE CurRefType  IS REF CURSOR;
  cv CurRefType;
  c city%ROWTYPE;
  BEGIN
    OPEN cv FOR
      'select * from city where country = :1'
      using ccode;
    LOOP
      FETCH cv into c;
      dbms_output.put_line(c.name);
      EXIT WHEN cv%NOTFOUND;
    END LOOP;
  END;
/
execute getcitiesCursor('AUS');
