CREATE OR ALTER PROCEDURE CURSADOS_SP (
    E_NRO_COMISION INTEGER)
RETURNS (
    NRO_ALUMNO INTEGER)
AS
BEGIN
  FOR
    SELECT
      ALUMNOS_PLANES.NRO_ALUMNO
    FROM COMISIONES_ALUMNOS
    INNER JOIN ALUMNOS_MATERIAS ON ALUMNOS_MATERIAS.NRO_ALUMNO_MATERIA = COMISIONES_ALUMNOS.NRO_ALUMNO_MATERIA
    INNER JOIN ALUMNOS_PLANES ON ALUMNOS_PLANES.NRO_ALUMNO_PLAN = ALUMNOS_MATERIAS.NRO_ALUMNO_PLAN
    WHERE
      COMISIONES_ALUMNOS.NRO_COMISION = :E_NRO_COMISION
    INTO
      :NRO_ALUMNO
  DO SUSPEND;
END