Using Suprtool for Mass Updates

Suprtool has a feature called Update-From-Table that allows you to update a dataset from a table of values. In other words, you have a file that contains two fields: one is the key field of the dataset and the other one is the new value for another field in the record.

However, if the key field in the file is actually a search key in the database, then there is another way to do such "mass updates", a much more devious way:

You read the data file and convert it into a Suprtool script. In this example, the DATAFILE is a self-describing file with two fields: "KEYVALUE" which is a product-id, and "NEWVALUE" which is the new product description to update. You can modify the UPPERCASE names in this example to match your data names.

ext 'chain DATASET, PRODUCT-ID="', KEYVALUE , '"'
ext ';update ciupdate'
ext ';ext PRODUCT-DESC="', NEWVALUE, '"'
ext ';xeq'


Note that we assumed character fields in this example. remove the double quotes if your are working with numeric fields.

....Back to the Suprtool Q&A Page