select a.*,
TO_CHAR(a.spfhdt, 'yyyy/mm/dd hh24:mi') as d_spfhdt,
TO_CHAR(a.spreg, 'yyyy/mm/dd hh24:mi') as d_spreg,
TO_CHAR(a.spupd, 'yyyy/mm/dd hh24:mi') as d_spupd,
TO_CHAR(a.spstp, 'yyyy/mm/dd hh24:mi') as d_spstp,
decode(a.spstp, null, '0', '1') as stpflg
from afm032 a
where a.cucd = :cucd and a.cuscd = :inpcd
