select a.*,
TO_CHAR(a.tday, 'yyyy/mm/dd') as d_tday,
TO_CHAR(a.reg, 'yyyy/mm/dd hh24:mi') as d_reg,
TO_CHAR(a.upd, 'yyyy/mm/dd hh24:mi') as d_upd,
TO_CHAR(a.stp, 'yyyy/mm/dd hh24:mi') as d_stp,
decode(a.stp, null, '0', '1') as stpflg
from afm05 a
where a.ktktcd = :inpcd
