/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

CREATE OR REPLACE VIEW xxas_perf_enrol_form_list_v AS 
  SELECT DISTINCT f.formula_name
  FROM   ff_formulas_f f  
		,ff_fdi_usages_f u1
		,ff_fdi_usages_f u2
		,FF_FORMULA_TYPES ft
  WHERE trunc(sysdate) BETWEEN f.effective_start_date AND f.effective_end_date
  AND   u1.formula_id = f.formula_id 
  AND   u2.formula_id = f.formula_id
  AND   u1.item_name ='ELIGIBLE'
  AND   u2.item_name='TITLE'
  AND   FT.FORMULA_TYPE_NAME = 'Applaud Assignment'
  AND   FT.FORMULA_TYPE_ID= f.FORMULA_TYPE_ID;
  
EXIT;