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
TRIMVARSPACES
andNOTRIMVARSPACES
at the root level of the parameter file. The default ofNOTRIMVARSPACES
is in effect until the lastMAP
statement, to whichTRIMVARSPACES
applies.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
TRIMVARSPACES
within aMAP
statement to override the global default ofNOTRIMVARSPACES
. The default applies to the first twoMAP
statements, and thenTRIMVARSPACES
applies 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;