varchar is not trimming spaces while loadding to oracle EE

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
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

varchar is not trimming spaces while loadding to oracle EE

Post by Madhu1981 »

Hi,

I have a varchar field of length 2000 and i am hardcoding the value as 'not valid' in the transformer. Now, when i am loading to the table using Loading method as "LOAD", it is behaving as char i.e it is taking the length as 2000, but when i am loading using UPSERT menthod, its going fine.

The job is quite simple

oracle EE ==> transformer ==> oracle EE tgt

Can any one explain me, how this is happening??

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Nor should it.

Code: Select all

INSERT INTO table(col1,col2) VALUES (123, "XYZ       ");
will preserve the trailing spaces, because they are part of the data. DataStage behaves in the same way. If you want them trimmed, you have to trim them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

Post by Madhu1981 »

ray.wurlod wrote:Nor should it.

Code: Select all

INSERT INTO table(col1,col2) VALUES (123, "XYZ       ");
will preserve the trailing spaces, because they are part of the data. DataStage b ...
Ray,

I am hardcoding it as "not validate" in the transformer.!! when i load using upsert method, then it is loading as not validate to the target where the length is 12 but when i use the load method it is loading as not validate followed with 1988 spaces. i checked the length of the vlaue ... all rows are returned as 2000

is this problem with sql loader or datastage ?? kindly help me.!!
Ramona Reed
Participant
Posts: 7
Joined: Thu Nov 17, 2005 7:22 am

Post by Ramona Reed »

You can place a Trim() around the value in a transform stage prior to the Oracle Load stage
With God all things are possible.
Post Reply