The Replicator Rdbms supports two powerful properties which can let you alter select / insert expressions.
These properties work like patterns : their value is executed as an Xpath expression where [columnName] is replaced with the source column name, or [value] with the inserted value.
We are going to use these properties to apply a trim() function on a selection of columns, either on the source or the target.
Trimming at selection on the source
The idea is to apply a trim() to every selected column whose type is CHAR.
{if (tech:type()='CHAR') then concat('trim(',tech:columnName(),')') else tech:columnName()}
Note : [columnName] cannot be used here because we opened an Xpath context with the curly brackets {}, this is why we use the Xpath expression tech:columnName() instead.
Trimming at insertion into the target
{if (tech:type() = 'STRING') then 'trim([value])' else '[value]'}