Preserve Trailing Blanks Setting in Oracle Connector

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
iq_etl
Premium Member
Premium Member
Posts: 105
Joined: Tue Feb 08, 2011 9:26 am

Preserve Trailing Blanks Setting in Oracle Connector

Post 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?
iq_etl
Premium Member
Premium Member
Posts: 105
Joined: Tue Feb 08, 2011 9:26 am

Post by iq_etl »

No one has come across this behavior when attempting to set the 'Preserve Trailing Blanks' setting to 'No'?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Preserve Trailing Blanks Setting in Oracle Connector

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply