SELECT
  to_char(to_date(nm,'yy/mm/dd'),'yyyy/mm/dd') as taxdat,
  NVL(scls2, :hikazeicls) as b_keigen,
  NVL(scls3, :hikazeicls) as b_kazei,
  NVL(scls4, :hikazeicls) as a_keigen,
  NVL(scls5, :hikazeicls) as a_kazei
FROM afm90
WHERE cls = 'a'
  AND scls1 = fm_get_kazeikbn(to_char(to_date(:taxrtd,'yyyy/mm/dd'),'yy/mm/dd'),:ktktcd)
