create or replace procedure testProcedure1 (num IN integer) IS
studentName student.sname%TYPE; major student.major%TYPE;
CURSOR myCursor IS SELECT sName, major FROM Student;
BEGIN
  OPEN myCursor;
  FOR i IN 1 .. num LOOP
    FETCH myCursor INTO studentName, major;
    INSERT INTO newStudent VALUES (studentName, major);
  END LOOP;
  CLOSE myCursor;
END;
.
run;
