Page 1 of 1

Preserve Trailing Blanks Setting in Oracle Connector

Posted: Fri Nov 22, 2013 2:56 pm
by iq_etl
Per the online DS documentation, it looks as if we are to set the 'Preserve Trailing Blanks' setting to 'No' in the Oracle Connector stage, then trailing blanks in a column would be removed.

http://pic.dhe.ibm.com/infocenter/iisin ... lanks.html

Looking over that above link, I notice it mentions VARCHAR and NVARCHAR, but not CHAR. Is there an assumption that should be made to include CHAR as well?

This isn't what we're finding. We have columns defined as CHAR in our incoming Sequential File stage, but NVARCHAR in the target ORACLE CONNECTOR stage. Setting 'Preserve Trailing Blanks' to 'No' doesn't seem to have the result we'd guess. If an incoming field is CHAR (4) and is populated '123' then the table column is loaded with '123 ' (a fourth, trailing blank space).

We're using a workaround such as TrimB in the Transformer (moving CHAR 4 to NVARCHAR 4)to remove the blanks (necessary as the column is part of a join and search).

I would think that since the column is defined as NVARCHAR in the target Oracle Connector stage, then the 'Preserve Trailing Blanks' setting would work regardless of how the column is defined in the incoming Sequential File stage.

What have I missed?

Posted: Mon Dec 02, 2013 8:05 am
by iq_etl
No one has come across this behavior when attempting to set the 'Preserve Trailing Blanks' setting to 'No'?

Re: Preserve Trailing Blanks Setting in Oracle Connector

Posted: Mon Dec 02, 2013 8:16 am
by chulett
iq_etl wrote:Is there an assumption that should be made to include CHAR as well?
Nope. CHAR fields are always padded to full length, that's just the way the data type works in any database / tool. This option is only valid for variable length strings as the documentation notes.