VERS='6.03.008'

echo "Mise a jour CLIENTS pour Version $VERS"

isql - - <<EOT

DATABASE gc;

select code,ad_app,ad_bat,ad_num,ad_rue
from gc_cli2 into temp t1;

update gc_cli2 set ad_app = ad_app || " " || ad_bat
where code in (
  select code from t1
  where (ad_app is not null) OR (ad_app > '0')
);

update gc_cli2 set ad_app = ad_bat
where code in (
  select code from t1
  where (ad_app is null)
);

update gc_cli2 set ad_rue = ad_num || " " || ad_rue
where code in (
  select code from t1
  where (ad_num is not null) OR (ad_num > '0')
);

CLOSE DATABASE;

EOT

echo "Mise a jour CLIENTS terminee"
