Spaces getting added to the data from Oracle enterprise stag

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
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Spaces getting added to the data from Oracle enterprise stag

Post by Minhajuddin »

Hi all,

I have a job in which I retrieve data using a sparse lookup... Everything is working fine but for the trailing spaces which get added to all the varchars.

e.g. If I retrieve a column emp_name varchar(10) with value 'John'
The oracle stage is retrieving it as 'John '

Is this expected? and if so, Is there an easy fix for this other than using a modify stage or a transformer.

Thanks for the help.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

I don't think this is expected :) You might want to see this on the database side and make sure that data is stored in this way in the source/lookup itself or in the schema it is defined as char and not varchar.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It would be expected if you defined the column as CHAR(5) insteado f VARCHAR(5).
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Re: Spaces getting added to the data from Oracle enterprise

Post by JoshGeorge »

That confirms this is not expected as you have defined the column as VARCHAR(10) and not CHAR(10). Confirm the same on Oracle side.

Minhajuddin wrote: e.g. If I retrieve a column emp_name varchar(10) with value 'John'
The oracle stage is retrieving it as 'John '

Is this expected?
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What exact version of the Oracle client are you using? I've seen things like this where installing a 'better' client version can resolve it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

On your column metadata is the Unicode setting on? I have seen space issues when it is on depending on the source database settings.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Thanks for all the replies..

I don't have any spaces on the database side..
and the metadata is the same even in the database.
i.e. when I query the database from sqlplus I don't get spaces...
and the oracle client we are using is Oracle 9i. And lastly the unicode setting is not on.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I asked for the exact version - 9.2.0.4? 9.2.0.8? Makes a difference, some are buggier than others.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Hi Craig,

The exact version of the oracle client is 9.2.0.1.0

Did anybody have the same problem before?
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's pretty darn old. As noted, I've seen similar things. Ask your DBA to install a more recent release, 9.2.0.6 or 9.2.0.8 seem to be stable for us. No guarantees but it just may do the trick.
-craig

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