select a.cunm,a.cunms,a.cuknm,a.cuknms,a.spedi,
       a.cumcd4,g.cunm cumcd4nm,a.cumcd6,c.cunm cumcd6nm,a.cumcd3,h.cunm cumcd3nm,
       a.cuzip,a.cuad1,a.cuad2,a.cukad1,a.cukad2,a.cutel,a.cufax,a.culct,
       a.cuslcd,d.chgnm cuslnm,a.cuslcd2,f.chgnm cuslnm2,a.cubscd,e.chgnm cubsnm,a.kechg,i.chgnm kenm,
       a.cumcd2,b.cunm cumcd2nm,a.cudt1,a.cukbn,a.cusei,a.cuspflg,a.cuosflg,a.ketxt1,
       a.cusnm,a.cusknm,a.cuszip,a.cusad1,a.cusad2,a.cuskad1,a.cuskad2,a.custel,a.cusfax,a.cusmail,
       a.staxcls,nvl(a.cutax,'0') cutax,a.custdc,a.cutaxc,
       a.custdc1,a.cutaxc1,
       a.upchke,a.vdlmt,a.cllmt,a.samtchk,a.samtlmt,a.aslmt,
       a.cusacls,a.dcubcd,a.dcls,a.cucat,a.cuhcls,a.cucpcls,a.asflg,a.curtcls,
       nvl(a.cutaxdiv,'0') cutaxdiv,nvl(a.cutaxmxtrt,'0') cutaxmxtrt,nvl(a.cutaxdiff,'1') cutaxdiff,
       a.ltxt1,a.ltxt2,a.dtxt1,a.dtxt2,a.com3,a.com2,
       a.cudenp1,a.salpcls,a.cstpcls,a.dmzkflg,a.dtcor,a.dyflg,
       a.cuedi,a.cudpcls,a.dhfflg,a.dgsiflg,a.spnoflg,a.stcorflg,
       a.cudenp2,a.salpcls2,a.cstpcls2,a.dmzkflg2,a.dtcor2,a.dyflg2,
       a.cudpcls2,a.dhfflg2,a.dgsiflg2,a.spnoflg2,a.stcorflg2,
       a.com,a.jwcom,a.cuflcls,a.cuflamt,
       a.rper1,a.rper2,a.rper3,a.rper4,a.rper5,
       a.jcls,a.cucuc,
       a.cuptax,a.cupcls,a.cupdt,a.cupmn,a.cupycls,a.com4,
       a.pcflg,a.curgin,a.cencls,a.cubyr1,a.cubyr2,a.cubyr3,a.cubyr4,a.cubyr5,a.undkbn,a.com3,
       to_char(a.cureg,'yyyy/mm/dd hh24:mi') cureg,
       to_char(a.cuupd,'yyyy/mm/dd hh24:mi') cuupd,
       to_char(a.custp,'yyyy/mm/dd hh24:mi') custp
from afm08 i,afm03 h,afm03 g,afm08 f,afm08 e,afm08 d,afm03 c,afm03 b,afm03 a
where a.cucd = :cucd
  and a.cumcd2=b.cucd(+)
  and a.cumcd4=g.cucd(+)
  and a.cumcd6=c.cucd(+)
  and a.cumcd3=h.cucd(+)
  and a.cuslcd=d.chgcd(+)
  and a.cuslcd2=f.chgcd(+)
  and a.cubscd=e.chgcd(+)
  and a.kechg=i.chgcd(+)

