OCI Stage - Issue with reading decimal values

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
vincentjeevan
Participant
Posts: 12
Joined: Thu Jan 08, 2004 9:45 am

OCI Stage - Issue with reading decimal values

Post by vincentjeevan »

Hi, I am reading data from an Oracle table using OCI stage but the decimal data seems to be appending additional digits at the end. For example 1234 is appended as 12344. I have this issue only in Prod environment but not in the development environment. Please advise. Any inputs on this will he highly appreciated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is different between production and development? ("Nothing" is not the correct answer.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: OCI Stage - Issue with reading decimal values

Post by SURA »

Hi

Try to read it as varchar.

Ram
vincentjeevan wrote:Hi, I am reading data from an Oracle table using OCI stage but the decimal data seems to be appending additional digits at the end. For example 1234 is appended as 12344. I have this issue only in Prod environment but not in the development environment. Please advise. Any inputs on this will he highly appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Shouldn't be necessary.

If I had to guess, I'd venture one that you have a different Oracle client installed in Production.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vincentjeevan
Participant
Posts: 12
Joined: Thu Jan 08, 2004 9:45 am

Post by vincentjeevan »

Yes. I just noticed that the Oracle client versions are different between prod and dev datastage server. (Prod-10.1.0.5.0 and dev-10.2.0.1.0). But I believe DS should work fine in both versions. Is there a known issue with either of these oracle versions?

chulett wrote:Shouldn't be necessary.

If I had to guess, I'd venture one that you have a different Oracle client installed in Production. ...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This isn't a DataStage issue but rather an Oracle one. What version is your Oracle database - 10.1 or 10.2? Sure seems like you should get the 10.2 client onto production since that's the one working for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vincentjeevan
Participant
Posts: 12
Joined: Thu Jan 08, 2004 9:45 am

Post by vincentjeevan »

My database version is 8.1.7.4.0. It is same in both prod and dev.
chulett wrote:This isn't a DataStage issue but rather an Oracle one. What version is your Oracle database - 10.1 or 10.2? Sure seems like you should get the 10.2 client onto production since that's the one w ...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Oh my, even worse news. There is no guarantee of compatibility from Oracle between new clients and old databases. However, old clients can generally be used without issue against newer databases.

If that 8.1 database is your only Oracle source/target, then you really need to get a matching 8.1 client installed on the DataStage server for it to use. If you have a mix of database versions, then the solution becomes more problematical depending on said mixture. We use a 9i client to access both 9i and 10g databases without issue, but I would wager neither of those 10.x clients will be completely issue free accessing that 8 instance. You may think everything is working, but I'd be concerned that more strange things like those extra digits are waiting for you in the wings.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vincentjeevan
Participant
Posts: 12
Joined: Thu Jan 08, 2004 9:45 am

Post by vincentjeevan »

Thanks. I think keeping client & oracle versions in sync is the solution for this. But changing the version not possible here as the oracle client is used by few other applications as well.

As a temporary fix I used TO_CHAR() function to convert all Decimal values to VARCHAR in OCI stage and then converting it back to decimal in Transformer stage.

Also adding a SORT BY clause on the decimal field seems to be working. But I am not sure if it will work when there are more than one decimal field in the query (I only have one decimal field in my query).

If there is any other fix to this problem please let me know.
chulett wrote:Oh my, even worse news. There is no guarantee of compatibility from Oracle between new clients and old databases. However, old clients can generally be used without issue against newer databases.

If that 8.1 database is your only Oracle source/target, then you really need to get a matching 8.1 client installed on the DataStage server for it to use. If you have a mix of database versions, then the solution becomes more problematical depending on said mixture. We use a 9i client to access both 9i and 10g databases without issue, but I would wager neither of those 10.x clients will be completely issue free accessing that 8 instance. You may think everything is working, but I'd be concerned that more strange things like those extra digits are waiting for you in the wings.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Didn't say you needed to change the Oracle client, simply have your DBA add another one, an 8.1 client in this case. Then point DataStage to that client by setting $ORACLE_HOME to it in the dsenv file.

No other applications would be affected.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vincentjeevan
Participant
Posts: 12
Joined: Thu Jan 08, 2004 9:45 am

Post by vincentjeevan »

Thanks. i'll request the DBA to install 8.1 client.
chulett wrote:Didn't say you needed to change the Oracle client, simply have your DBA add another one, an 8.1 client in this case. Then point DataStage to that client by setting $ORACLE_HOME to it in the dsenv file.

No other applications would be affected.
say2prabhu1
Participant
Posts: 27
Joined: Mon Jul 09, 2007 1:06 am

Post by say2prabhu1 »

Use cast function while reading the oracle decimal values..

For example , Table T1 has column A has decimal datatype (12,3) means

Try to read the above A column value as VARCHAR usinf cast function

Select (cast ( a as Varchar(15)) A
from T1(Table)

This wll help you out ..
Post Reply