If there isn't a field with the old fieldname, a new one isn't created (in case you need to run the agent multiple times -> doesn't blank the new fields).
_fieldNamesFrom := "silly_fieldname" : "tpyo_fieldname";
_fieldNamesTo := "crazy_fieldname" : "correct_fieldname";
@For( i := 1 ; i <= @Elements( _fieldNamesFrom ) ; i := i + 1 ;
_valueFrom := @GetField( _fieldNamesFrom[i] );
@If( _valueFrom = "" ; "" ; @SetField( _fieldNamesTo[i] ; _valueFrom ) );
@SetField( _fieldNamesFrom[i] ; @Unavailable )
);
SELECT @All
I post this as much for myself as for you, as I tend to delete the renaming agents after they've done their duty.
0 comments:
Post a Comment