VERS='5.4.51'

echo "Mise a jour de la base de donnees pour Version $VERS"

isql - - <<EOT

database gc;

update gc_parsys set version='$VERS';

alter table gc_cml add (statut integer);
update gc_cml set statut=0 where statut is null;;

drop index ix_cml01;
create index ix_cml01 on gc_cml (num, numlig);

alter table gc_archlf add (numligcom smallint);
update gc_archlf set numligcom=rowid where numligcom is null;

alter table gc_serie add (pxach float);
update gc_serie set pxach = 0 where pxach is null;

alter table gc_serjcpt add (qtt float);

alter table gc_vlae add (coefrev float);
update gc_vlae set coefrev=(
  select coefrev1 from gc_erc where 
  gc_erc.numdos=gc_vlae.numdos)
where coefrev is null;

close database;

EOT

chmod 666 $DBPATH/gc.dbs/*.idx
chmod 666 $DBPATH/gc.dbs/*.dat

echo "Mise a jour terminee"

 
