1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <div style="margin-left:40px"> $req = "select
t1.numvag, t1.libvag,
t2.numsup,
t3.seqsup, t3.numliv, t3.codpro, t3.ds1pro, t3.uvccde, t3.uvcliv, t3.zonsts, t3.allsts, t3.dplsts, t3.nivsts, t3.zonpic, t3.allpic, t3.dplpic, t3.nivpic,
t4.codprn,
t5.ds1pro as libprn,
t6.qtecol,
t7.codcli, t7.codtra, t7.refliv, t7.datliv, t7.msgliv1, t7.msgliv2,
t8.nobl, t8.nomcli, t8.prenomcli, t8.adr1, t8.adr2, t8.adr3, t8.cp, t8.ville, t8.pays, t8.tel1, t8.tel2, t8.magasin, t8.codepays,
t9.cirpic,
t10.nomcli as codcli2</div> <div style="margin-left:40px"> from (((((((((fge50.gevag as t1 left join fge50.gesupe as t2 on t1.numvag=t2.numvag)
left join fge50.gesupd as t3 on t2.numsup=t3.numsup and t2.snusup=t3.snusup)
left join fge50.geprnd as t4 on t3.codpro=t4.codpro and t3.codact=t4.codact and t3.codprn=t4.codprn)
left join fge50.geprne as t5 on t4.codprn=t5.codprn and t4.codact=t5.codact )
left join distrimag.genomenclature as t6 on t3.codpro=t6.codpro)
left join fge50.gelive as t7 on t3.numliv=t7.numliv and t3.snuliv=t7.snuliv )
left join distrimag.adrclient as t8 on ( case when substr(t7.msgliv1, 1, 1)<>'#' then 0 when substr(t7.msgliv1, 8, 1)<>'#' then substr(t7.msgliv1, 2, 7) else substr(t7.msgliv1, 2, 6) end)=t8.nobl)
left join fge50.gepic as t9 on t3.codpro=t9.codpro and t3.codact=t9.codact)
left join fge50.gecli as t10 on t7.codcli=t10.codcli and t3.codact=t10.codact)
where t1.numvag=11185040";</div>
$result = odbc( _AS400_ , $req );
while( $row = odbc_fetch_array( $result ) ){
.....
} |
Partager