SELECT
  BVCOMP AS bvcomp,
  RTRIM(BVCUST) AS bvcust,
  RTRIM(BVNAME) AS bvname,
  RTRIM(BVADR1) AS bvadr1,
  RTRIM(BVADR2) AS bvadr2,
  RTRIM(BVADR3) AS bvadr3,
  RTRIM(BVADR4) AS bvadr4,
  RTRIM(BVADR5) AS bvadr5,
  RTRIM(BVADR6) AS bvadr6,
  RTRIM(BVADR7) AS bvadr7,
  RTRIM(BVADR8) AS bvadr8,
  RTRIM(BVADR9) AS bvadr9,
  RTRIM(BVADR10) AS bvadr10,
  RTRIM(BVPOST) AS bvpost,
  RTRIM(BVCITY) AS bvcity,
  RTRIM(BVPROV) AS bvprov,
  RTRIM(BVCTRY) AS bvctry,
  RTRIM(BVTELP) AS bvtelp,
  RTRIM(BVBORD) AS bvbord,
  RTRIM(BVPRAR) AS bvprar,
  RTRIM(BVPSTE) AS bvpste,
  RTRIM(BVPRCD) AS bvprcd,
  RTRIM(BVPSTL) AS bvpstl,
  RTRIM(BVFSTE) AS bvfste,
  RTRIM(BVTXGR) AS bvtxgr,
  RTRIM(BVTXRT) AS bvtxrt,
  RTRIM(BVPACK) AS bvpack,
  RTRIM(BVNU10) AS bvnu10,
  RTRIM(BVSALM) AS bvsalm,
  RTRIM(BVTERR) AS bvterr,
  RTRIM(BVSNOT) AS bvsnot,
  RTRIM(BVCURR) AS bvcurr,
  RTRIM(BVSCOM) AS bvscom,
  RTRIM(BVTYPE) AS bvtype,
  RTRIM(BVCRLE) AS bvcrle,
  RTRIM(BVGSTE) AS bvgste,
  BVCREL AS bvcrel,
  RTRIM(BVOEM) AS bvoem,
  RTRIM(BVLANG) AS bvlang,
  BVSHLT AS bvshlt,
  RTRIM(BVINPO) AS bvinpo,
  RTRIM(BVTERM) AS bvterm,
  RTRIM(BVSHCL) AS bvshcl,
  RTRIM(BV1B) AS bv1b,
  BVDISL AS bvdisl,
  RTRIM(BVARCD) AS bvarcd,
  RTRIM(BVINT) AS bvint,
  BVSDAY AS bvsday,
  RTRIM(BVPORQ) AS bvporq,
  RTRIM(BVCLAS) AS bvclas,
  RTRIM(BVPSTC) AS bvpstc,
  CASE WHEN BVLDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BVLDAT END AS bvldat,
  BVLINA AS bvlina,
  CASE WHEN BVPDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BVPDAT END AS bvpdat,
  BVLPAA AS bvlpaa,
  BVYTDS AS bvytds,
  BVLYTD AS bvlytd,
  BVOUTB AS bvoutb,
  RTRIM(BV15) AS bv15,
  RTRIM(BVDUNN) AS bvdunn,
  RTRIM(BVFAX) AS bvfax,
  CASE WHEN BVMDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BVMDAT END AS bvmdat,
  RTRIM(BVBILL) AS bvbill,
  RTRIM(BVGSTL) AS bvgstl,
  RTRIM(BV3) AS bv3,
  BVLARA AS bvlara,
  RTRIM(BVCONT) AS bvcont,
  RTRIM(BVSUPP) AS bvsupp,
  RTRIM(BVSFOR) AS bvsfor,
  BVSFCP AS bvsfcp,
  RTRIM(BVMFOR) AS bvmfor,
  BVMFCP AS bvmfcp,
  RTRIM(BVXFOR) AS bvxfor,
  BVXFCP AS bvxfcp,
  RTRIM(BVCARC) AS bvcarc,
  RTRIM(BVSERC) AS bvserc,
  RTRIM(BVSUPA) AS bvsupa,
  RTRIM(BVTRDP) AS bvtrdp,
  RTRIM(BVDUNS) AS bvduns,
  RTRIM(BVSFID) AS bvsfid,
  RTRIM(BVUSEC) AS bvusec,
  RTRIM(BVSHPR) AS bvshpr,
  RTRIM(BVASNY) AS bvasny,
  RTRIM(BVINVY) AS bvinvy,
  RTRIM(BVFLG1) AS bvflg1,
  RTRIM(BVFLG2) AS bvflg2,
  RTRIM(BVFLG3) AS bvflg3,
  RTRIM(BVFLG4) AS bvflg4,
  RTRIM(BVFLG5) AS bvflg5,
  RTRIM(BVFLG6) AS bvflg6,
  RTRIM(BVSUMR) AS bvsumr,
  RTRIM(BVPLNT) AS bvplnt,
  RTRIM(BVDOCK) AS bvdock,
  RTRIM(BVLINE) AS bvline,
  RTRIM(BVDROP) AS bvdrop,
  RTRIM(BVTMOD) AS bvtmod,
  RTRIM(BVTTYP) AS bvttyp,
  RTRIM(BVEQPI) AS bveqpi,
  RTRIM(BVROUT) AS bvrout,
  RTRIM(BVPOOL) AS bvpool,
  RTRIM(BVPOLL) AS bvpoll,
  RTRIM(BVJITF) AS bvjitf,
  RTRIM(BVAPLG) AS bvaplg,
  RTRIM(BVAVER) AS bvaver,
  RTRIM(BVUVER) AS bvuver,
  RTRIM(BVFOBC) AS bvfobc,
  RTRIM(BVEMAL) AS bvemal,
  RTRIM(BVWEB) AS bvweb,
  RTRIM(BVDDIR) AS bvddir,
  RTRIM(BVFL01) AS bvfl01,
  RTRIM(BVADJC) AS bvadjc,
  RTRIM(BVPPCL) AS bvppcl,
  CASE WHEN BVCDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BVCDAT END AS bvcdat,
  RTRIM(BVIBRQ) AS bvibrq,
  RTRIM(BVORSM) AS bvorsm,
  RTRIM(BVFL04) AS bvfl04,
  RTRIM(BVSTAT) AS bvstat,
  RTRIM(BVREAS) AS bvreas,
  RTRIM(BVFL05) AS bvfl05,
  RTRIM(BVFL06) AS bvfl06,
  RTRIM(BVFL07) AS bvfl07,
  RTRIM(BVCSERD) AS bvcserd,
  RTRIM(BVFL08) AS bvfl08,
  RTRIM(BVFL09) AS bvfl09,
  RTRIM(BVFL10) AS bvfl10,
  RTRIM(BVFL11) AS bvfl11,
  RTRIM(BVFL12) AS bvfl12,
  CASE WHEN BVFL13 IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BVFL13 END AS bvfl13,
  CASE WHEN BVFL14 IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BVFL14 END AS bvfl14,
  BVFL15 AS bvfl15,
  BVFL16 AS bvfl16,
  RTRIM(BVFL17) AS bvfl17,
  RTRIM(BVFL18) AS bvfl18,
  RTRIM(BVFL19) AS bvfl19,
  RTRIM(BVFL20) AS bvfl20,
  RTRIM(BVVRFKB) AS bvvrfkb,
  RTRIM(BVGRPCK) AS bvgrpck,
  RTRIM(BVSWAP) AS bvswap,
  RTRIM(BVICON) AS bvicon,
  RTRIM(BVINSP) AS bvinsp,
  RTRIM(BVALS) AS bvals,
  RTRIM(BVFUT2) AS bvfut2,
  RTRIM(BVFUT3) AS bvfut3,
  RTRIM(BVFUT4) AS bvfut4,
  RTRIM(BVFUT5) AS bvfut5,
  RTRIM(BVFUT6) AS bvfut6,
  RTRIM(BVFUT7) AS bvfut7,
  RTRIM(BVFUT8) AS bvfut8,
  RTRIM(BVFUT9) AS bvfut9,
  RTRIM(BVFUT10) AS bvfut10,
  RTRIM(BVFUT11) AS bvfut11,
  RTRIM(BVFUT12) AS bvfut12,
  RTRIM(BVFUT13) AS bvfut13,
  RTRIM(BVFUT14) AS bvfut14,
  RTRIM(BVFUT15) AS bvfut15,
  RTRIM(BVTMZN) AS bvtmzn,
  BVSLT AS bvslt,
  RTRIM(BVSLTU) AS bvsltu,
  RTRIM(BVUPSC) AS bvupsc,
  RTRIM(BVSEAL) AS bvseal,
  RTRIM(BVSTRQ) AS bvstrq,
  RTRIM(BVWTPT) AS bvwtpt,
  RTRIM(BVINCD) AS bvincd,
  RTRIM(BVWCAR) AS bvwcar,
  RTRIM(BVSVPO) AS bvsvpo,
  RTRIM(BVSVCT) AS bvsvct,
  RTRIM(BVFSTR) AS bvfstr,
  BVTRVL AS bvtrvl,
  BVCTIM AS bvctim,
  RTRIM(BVCUSR) AS bvcusr,
  BVMTIM AS bvmtim,
  RTRIM(BVMUSR) AS bvmusr,
  RTRIM(BVSEBP) AS bvsebp,
  RTRIM(BVWESS) AS bvwess,
  RTRIM(BVFUT16) AS bvfut16,
  RTRIM(BVFUT17) AS bvfut17,
  RTRIM(BVFUT18) AS bvfut18,
  RTRIM(BVFUT19) AS bvfut19,
  RTRIM(BVFUT20) AS bvfut20,
  RTRIM(BVFUT21) AS bvfut21,
  RTRIM(BVFUT22) AS bvfut22,
  RTRIM(BVFUT23) AS bvfut23,
  RTRIM(BVFUT24) AS bvfut24,
  RTRIM(BVFUT25) AS bvfut25,
  RTRIM(BVFUT26) AS bvfut26,
  RTRIM(BVFUT27) AS bvfut27,
  RTRIM(BVFUT28) AS bvfut28,
  RTRIM(BVFUT29) AS bvfut29,
  RTRIM(BVFUT30) AS bvfut30,
  RTRIM(BVHIN) AS bvhin,
  RTRIM(BVDOCKF) AS bvdockf,
  RTRIM(BVORLNF) AS bvorlnf,
  RTRIM(BVCLOC) AS bvcloc,
  RTRIM(BVDLRD) AS bvdlrd,
  RTRIM(BVSLTT) AS bvsltt,
  RTRIM(BVVSM) AS bvvsm,
  RTRIM(BVMRWM) AS bvmrwm,
  RTRIM(BVEDIPW) AS bvedipw,
  RTRIM(BVSPUF) AS bvspuf,
  RTRIM(BVSLZN) AS bvslzn,
  BVHFEP AS bvhfep,
  BVARGP AS bvargp,
  RTRIM(BVCSPO) AS bvcspo,
  BVSHPD AS bvshpd,
  BVSHPT AS bvshpt,
  RTRIM(BVOOSF) AS bvoosf,
  RTRIM(BVSCILC) AS bvscilc,
  RTRIM(BVSCICI) AS bvscici,
  BVSCIGD AS bvscigd,
  BVSCIGD2 AS bvscigd2,
  RTRIM(BVARCOL) AS bvarcol,
  RTRIM(BVDCLS) AS bvdcls,
  RTRIM(BVSCHL) AS bvschl,
  RTRIM(BVARSP) AS bvarsp,
  RTRIM(BVACBOL) AS bvacbol,
  RTRIM(BVSOSO) AS bvsoso,
  RTRIM(BVRTXR) AS bvrtxr,
  RTRIM(BVPODCF) AS bvpodcf,
  RTRIM(BVADSSC) AS bvadssc,
  RTRIM(BVPODCC) AS bvpodcc,
  RTRIM(BVATFE) AS bvatfe,
  RTRIM(BVVIDO) AS bvvido,
  RTRIM(BVUCFS) AS bvucfs,
  RTRIM(BVSISR) AS bvsisr,
  RTRIM(BVNBBL) AS bvnbbl,
  RTRIM(BVSITL) AS bvsitl,
  RTRIM(BVSIAL) AS bvsial,
  RTRIM(BVSIOE) AS bvsioe
FROM LGDAT.CUST
