select a.*,
to_char(a.cureg, 'yyyy/mm/dd hh24:mi') as d_cureg,
to_char(a.cuupd, 'yyyy/mm/dd hh24:mi') as d_cuupd,
to_char(a.custp, 'yyyy/mm/dd hh24:mi') as d_custp,
decode(a.custp, null, '0', '1') as stpflg
from afm03 a
where a.cucd = :inpcd
