SELECT A1.LM_LPLN_ID , A1.LM_PERSON_ID , A1.LM_PRG_REG_ID , A1.LM_ENRLMT_ID , A1.LM_ADHC_LRN_ID , CITLG1.LANGUAGE_CD , CITLG1.LM_CS_LONG_NM , ACTLG1.LM_DM_LONG_NM FROM PS_LM_LPLN_DTL A1 , PS_LM_ENRLMT ENRL1 , PS_LM_CI_TBL CIT1 , PS_LM_CI_LANG CITLG1 , PS_LM_ACT_PLN_VW ACT1 , PS_LM_ACT_PLN_LVW ACTLG1 WHERE A1.LM_ENRLMT_ID = ENRL1.LM_ENRLMT_ID AND ENRL1.LM_CI_ID = CIT1.LM_CI_ID AND ENRL1.LM_ACT_ID = ACT1.LM_ACT_ID AND %CurrentDateIn BETWEEN CIT1.EFFDT AND CIT1.LM_END_EFFDT AND CIT1.LM_CI_STATUS = '10' AND NOT(ENRL1.LM_STTS = 'CANC' AND ENRL1.LM_TYPE = 'PLAN') AND CIT1.LM_CI_ID = CITLG1.LM_CI_ID AND CIT1.EFFDT = CITLG1.EFFDT AND ACT1.LM_ACT_ID = ACTLG1.LM_ACT_ID AND CITLG1.LANGUAGE_CD = ACTLG1.LANGUAGE_CD UNION SELECT A2.LM_LPLN_ID , A2.LM_PERSON_ID , A2.LM_PRG_REG_ID , A2.LM_ENRLMT_ID , A2.LM_ADHC_LRN_ID , CITLG2.LANGUAGE_CD , CITLG2.LM_CS_LONG_NM , ACT2.LM_DM_LONG_NM FROM PS_LM_LPLN_DTL A2 , PS_LM_ENRLMT ENRL2 , PS_LM_CI_TBL CIT2 , PS_LM_CI_LANG CITLG2 , PS_LM_ACT_PLN_VW ACT2 WHERE A2.LM_ENRLMT_ID = ENRL2.LM_ENRLMT_ID AND ENRL2.LM_CI_ID = CIT2.LM_CI_ID AND ENRL2.LM_ACT_ID = ACT2.LM_ACT_ID AND %CurrentDateIn BETWEEN CIT2.EFFDT AND CIT2.LM_END_EFFDT AND CIT2.LM_CI_STATUS = '10' AND NOT(ENRL2.LM_STTS = 'CANC' AND ENRL2.LM_TYPE = 'PLAN') AND CIT2.LM_CI_ID = CITLG2.LM_CI_ID AND CIT2.EFFDT = CITLG2.EFFDT AND NOT EXISTS ( SELECT 1 FROM PS_LM_ACT_PLN_LVW ACTLG2 WHERE ACT2.LM_ACT_ID = ACTLG2.LM_ACT_ID AND CITLG2.LANGUAGE_CD = ACTLG2.LANGUAGE_CD) UNION SELECT A3.LM_LPLN_ID , A3.LM_PERSON_ID , A3.LM_PRG_REG_ID , A3.LM_ENRLMT_ID , A3.LM_ADHC_LRN_ID , ACTLG3.LANGUAGE_CD , CIT3.LM_CS_LONG_NM , ACTLG3.LM_DM_LONG_NM FROM PS_LM_LPLN_DTL A3 , PS_LM_ENRLMT ENRL3 , PS_LM_CI_TBL CIT3 , PS_LM_ACT_PLN_VW ACT3 , PS_LM_ACT_PLN_LVW ACTLG3 WHERE A3.LM_ENRLMT_ID = ENRL3.LM_ENRLMT_ID AND ENRL3.LM_CI_ID = CIT3.LM_CI_ID AND ENRL3.LM_ACT_ID = ACT3.LM_ACT_ID AND %CurrentDateIn BETWEEN CIT3.EFFDT AND CIT3.LM_END_EFFDT AND CIT3.LM_CI_STATUS = '10' AND NOT(ENRL3.LM_STTS = 'CANC' AND ENRL3.LM_TYPE = 'PLAN') AND NOT EXISTS ( SELECT 1 FROM PS_LM_CI_LANG CITLG3 WHERE CIT3.LM_CI_ID = CITLG3.LM_CI_ID AND CIT3.EFFDT = CITLG3.EFFDT AND CITLG3.LANGUAGE_CD = ACTLG3.LANGUAGE_CD) AND ACT3.LM_ACT_ID = ACTLG3.LM_ACT_ID
|