C環境
http://lyncs.hateblo.jp/entry/2018/03/11/032127
pamClientCd=$(awk -F'[,]' '{print $3}' <<<${line})
(
CASE
WHEN M02.PF_ID_CLS = '1'
THEN CASE
WHEN NVL(M02.CURTAIN_TIME, '2359') > '2359'
THEN CASE
WHEN M02.PF_DATE > '99991229'
THEN TO_DATE('99991231', 'YYYYMMDD')
ELSE TO_DATE(M02.PF_DATE, 'YYYYMMDD') + 1 + 1
END
ELSE CASE
WHEN M02.PF_DATE > '99991230'
THEN TO_DATE('99991231', 'YYYYMMDD')
ELSE TO_DATE(M02.PF_DATE, 'YYYYMMDD') + 1
END
END
END
) >= TO_DATE(:gUnyoDate, 'YYYYMMDD')