Maintaining SQL-based Clients (updateccdb utility)
updateccdb utility works for current company or for company specified with -C option.
If it will fail and there will be something like failed because of other objects depends on it in updateccdb.log file, we should drop view using: createccview -s -d and then recreate them after running updateccdb.
updateccdb -a should be added to crontab list to run every day at night time. It will check all tables for new/changed fields to avoid invalid read/write request and analyze tables (-a option) to improve performance.
Below are a few things you should consider before installing or updating any new sql programs:
If any new fields have been added to the Company or Branch record, corresponding tables should be updated manualy using sql prompt: (ALTER TABLE TableName ADD FieldName FieldType;). Also there are some issues with glcont record - it can be updated using standart updateccdb, but conset to another company will not work anymore).
If any new fields have been added to any record, updateccdb should be run. To ensure that the programs refer to the correct fields it is good idea to run updateccdb every time when new programm getting copied to customer site.
Programmers should be very wary of renaming fields, especially if the data in those fields are to stay in use. In this case utility would need to be run to ensure the field renaming happens correctly.
createccview -s -d #drop existant views updateccdb -r -o oldName -n newName [-f fileName] #if no filename specified, it will rename columns for ALL datatypes (not recomended) because does not make too much sense. createccview -s #recreate views
If the field is just being renamed as it is being taken out of use or used for something else (if data should not be transfered from old field to new one), updateccdb will leave old one in the database and create column for new one (if the new one is not one of those FILL field). To reclaim disk space you need to run updateccdb with -d option (it will prompt for confirmation for each field being removed).
FOR PROGRAMMERS: If for some reason we will need to change internal database type (if updateccdb without argument failed, ...) we should run:
updateccdb -c -o oldtype #we can get oldtype from updateccdb log file
Exporting data from SQL database to our Control file format
exportccdb [-f filename] [-s] [-o] -f filename export only specified file/table name (optional, export all by default)
-s silent or script mode, do not ask for confirmation
-o overwrite file if exist
