I have to update a record on Table with ValidTimeStateFieldType UTCDateTime, but I need to Update only a string field. If I use this code:
while select forUpdate MyTable
{
MyTable.StringField = "Test";
MyTable_UPD.validTimeStateUpdateMode(ValidTimeStateUpdate::EffectiveBased);
ttsbegin;
MyTable.update();
ttscommit;
}
After command MyTable.update(); change the value on table MyTable.ValidFrom or MyTable.ValidTo.
I need to change only the value on StringField, I don't need to change the values on ValidFrom/To. I want to preserve the same information on UTC field and I don't want to create a new record.
If I use MyTable.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction); I receive an error.
It's possible to change only value and don't touch anything on ValueFrom/To field?
Thanks,
enjoy!
If I am not mistaken it is not possible to modify only your
StringFieldbecause in your table in Indexes you have definedDateTimefield.You need use
validTimeStateUpdateModefunction, in your code useMyTableand thenMyTable.update()but you usevalidTimeStateUpdateMode(ValidTimeStateUpdate::EffectiveBased);inMyTable_UPDnotMyTable.Try This: