FITOMN of AM v3
8/25/2017 - 10:02 PM

CREATE sp2RPT_CES_ListarPlanEstudiosxListOfEducPeriodo - Lista planes de estudio en base a una lista de ofertas educativas y un folio de per

CREATE sp2RPT_CES_ListarPlanEstudiosxListOfEducPeriodo - Lista planes de estudio en base a una lista de ofertas educativas y un folio de periodo


----------------------------INICIO PROCEDIMIENTO ------------------------
IF OBJECT_ID('sp2RPT_CES_ListarPlanEstudiosxListOfEducPeriodo', 'P') IS NOT NULL
      DROP PROC sp2RPT_CES_ListarPlanEstudiosxListOfEducPeriodo 
GO

CREATE PROCEDURE [dbo].[sp2RPT_CES_ListarPlanEstudiosxListOfEducPeriodo]
  @idOfEduc      listaSmallInt READONLY,
  @iFolioPeriodo BIGINT
/* --------------------------------------------------------------------------------------------------------------
	FECHA	   |    AUTOR		|	DESCRIPCION
 25/ago./2017  | Luis Bernal	| 
--------------------------------------------------------------------------------------------------------------*/
AS
  BEGIN
      SET NOCOUNT ON;

      SELECT DISTINCT cpe.idPlanEstudios
                     ,cpe.sNombre + ' (' + cpe.sVersion + ')' AS sPlanEstudiosV
                     ,cpe.idFormEvaluacion
                     ,cpe.iDuracion
                     ,cpe.idOfEduc
                     ,cpe.bActivo
                     ,cpe.idPlan
      FROM   Cat_PlanEstudios AS cpe
			 INNER JOIN @idOfEduc AS ioe ON ioe.id = cpe.idOfEduc
             INNER JOIN Ctrl_Periodos AS cp ON cp.iFolio = @iFolioPeriodo
											   AND cp.idPlan = cpe.idPlan
      WHERE cpe.bActivo = 1
      ORDER  BY cpe.sNombre + ' (' + cpe.sVersion + ')'
  END