Page 1 of 1

Updating a single column in a hash file.

Posted: Mon Oct 18, 2004 1:53 pm
by KeithM
Is it possible to update just a single column in a hash file without losing the rest of the data on the record? I have a hash file records that consists of a key, a status, and some other data. I want to just update the status but when I do just the single field the rest of the data is cleared. Is it possible to do this without reading the record first to get other data?

Posted: Mon Oct 18, 2004 2:44 pm
by chulett
No, not that I am aware of... as least not directly. You may be able to access the hash via a UV stage and then do 'normal' SQL against the data. You'd need to either have the hash in your Project or create a VOC record for it (if pathed) for the UV stage to work.

Posted: Mon Oct 18, 2004 2:44 pm
by kduke
Change it to a UV stage. You can do any kind of SQL against it then. Another way is to exec a TCL command and give it an update statement.

Posted: Mon Oct 18, 2004 4:01 pm
by ray.wurlod
I also advocate the UV stage. The other method you specified, of reading the record first, updating it, and overwriting does work using Hashed File stages if you have some particular reason for wanting to do so. In this case, make sure that the link used for reading the record has "lock for update" set in its properties.