SELECT 0 , S0.LM_CI_ID , M307ALNG.LANGUAGE_CD , M307ALNG.MESSAGE_TEXT FROM PS_LM_CI_TBL S0 LEFT OUTER JOIN PSMSGCATDEFN M307A ON M307A.MESSAGE_SET_NBR = 18088 AND M307A.MESSAGE_NBR = 307 , PSMSGCATLANG M307ALNG WHERE M307A.MESSAGE_SET_NBR = M307ALNG.MESSAGE_SET_NBR AND M307A.MESSAGE_NBR = M307ALNG.MESSAGE_NBR AND %CurrentDateIn BETWEEN S0.EFFDT AND S0.LM_END_EFFDT AND NOT EXISTS ( SELECT 1 FROM PS_LM_ACT X0 WHERE X0.LM_CI_ID = S0.LM_CI_ID) UNION SELECT S1.LM_ACT_ID , S1.LM_CI_ID , M307BLNG.LANGUAGE_CD , M307BLNG.MESSAGE_TEXT FROM PS_LM_ACT S1 LEFT OUTER JOIN PSMSGCATDEFN M307B ON M307B.MESSAGE_SET_NBR = 18088 AND M307B.MESSAGE_NBR = 307 , PSMSGCATLANG M307BLNG WHERE M307B.MESSAGE_SET_NBR = M307BLNG.MESSAGE_SET_NBR AND M307B.MESSAGE_NBR = M307BLNG.MESSAGE_NBR AND NOT EXISTS ( SELECT 1 FROM PS_LM_SES X1 WHERE X1.LM_ACT_ID = S1.LM_ACT_ID) UNION SELECT A2.LM_ACT_ID , A2.LM_CI_ID , M307CLNG.LANGUAGE_CD , M307CLNG.MESSAGE_TEXT FROM PS_LM_SES S2 , PS_LM_ACT A2 LEFT OUTER JOIN PSMSGCATDEFN M307C ON M307C.MESSAGE_SET_NBR = 18088 AND M307C.MESSAGE_NBR = 307 , PSMSGCATLANG M307CLNG WHERE M307C.MESSAGE_SET_NBR = M307CLNG.MESSAGE_SET_NBR AND M307C.MESSAGE_NBR = M307CLNG.MESSAGE_NBR AND A2.LM_ACT_ID = S2.LM_ACT_ID AND S2.LM_SES_DT = ( SELECT MAX(X2.LM_SES_DT) FROM PS_LM_SES X2 WHERE X2.LM_ACT_ID = S2.LM_ACT_ID AND X2.LM_LC_ID = S2.LM_LC_ID AND X2.LM_SES_DT < %CurrentDateIn) UNION %Sql(LM_SRCH_EVENT_RLNG_SQL,7,308,<=,M308) UNION %Sql(LM_SRCH_EVENT_RLNG_SQL,30,309,<=,M309) UNION %Sql(LM_SRCH_EVENT_RLNG_SQL,60,310,<=,M310) UNION %Sql(LM_SRCH_EVENT_RLNG_SQL,90,311,<=,M311) UNION %Sql(LM_SRCH_EVENT_RLNG_SQL,90,312,>=,M312)
|