Oracle Load Issuse, Data loaded with trailing spaces

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
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Oracle Load Issuse, Data loaded with trailing spaces

Post by gsym »

Hey,

I am using LOAD option in oracle enterprise stage. When i load data into the VARCHAR Field, the data is getting loaded with spaces.

Example

Assume the job as follows

Oracle -----> Transformer------->Oracle

In transformer i am defaulting a value 'SM' for a column of datatype Varchar (5). when i load the data, its getting loaded as 'SM ' (with trailing spaces). I tried trimming the data via datastage but it dosent work.

is there any env variable to solve this issuse or any workaround? or is it a default characteristic of LOAD?
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

What is the data type defined in oracle for this field?
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Varchar2(5)

Post by gsym »

Its Varchar2(5)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You probably have a VarChar2 data type, which does get loaded with trailing spaces. Look up the use of the environment variable APT_ORACLE_PRESERVE_BLANKS and set it so that the spaces are preserved
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

I already tried that and still it dosent work.

Post by gsym »

The reason I set tht to true was, when we use SQL LOAD option via datastage, it treats " " as Null and it dosent get loaded into the non nullable column. But when I set this ENV varibale, it works fine.

Also When I use Insert, it dosent get loaded with trailing spaces
Post Reply