TRIMVARSPACES | NOTRIMVARSPACES
Valid For
Extract and Replicat
Description
Use the TRIMVARSPACES and NOTRIMVARSPACES parameters to control whether or not trailing spaces in a source VARCHAR column are truncated when applied to a target CHAR or VARCHAR column. TRIMVARSPACES and NOTRIMVARSPACES can be used at the root level of the parameter file as global ON/OFF switches for different sets of TABLE or MAP statements, and they can be used within an individual TABLE or MAP statement to override any global settings for that particular MAP or TABLE statement.
The default is NOTRIMVARSPACES because the spaces in a VARCHAR column can be part of the data. Before using TRIMVARSPACES, make certain that trailing spaces are not required as part of the target data.
For Extract, TRIMVARSPACES only has an effect if Extract is performing mapping within the TABLE statement (by means of a TARGET statement).
Default
NOTRIMVARSPACES
Syntax
TRIMVARSPACES | NOTRIMVARSPACES
Examples
- Example 1
-
The following example uses
TRIMVARSPACESandNOTRIMVARSPACESat the root level of the parameter file. The default ofNOTRIMVARSPACESis in effect until the lastMAPstatement, to whichTRIMVARSPACESapplies.MAP fin.src1, TARGET fin.tgt1; MAP fin.src2, TARGET fin.tgt2; MAP fin.src3, TARGET fin.tgt3; TRIMVARSPACES MAP fin.src4, TARGET fin.tgt4;
- Example 2
-
The following example uses
TRIMVARSPACESwithin aMAPstatement to override the global default ofNOTRIMVARSPACES. The default applies to the first twoMAPstatements, and thenTRIMVARSPACESapplies to the last two targets.MAP fin.src1, TARGET fin.tgt1; MAP fin.src1, TARGET fin.tgt2; MAP fin.src1, TARGET fin.tgt3, TRIMVARSPACES; MAP fin.src1, TARGET fin.tgt4, TRIMVARSPACES;