Datatype warnings from oracle!

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
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Datatype warnings from oracle!

Post by dspxlearn »

Hi,

I am pulling data from oracle database.Some of the fields are of NUMBER datatypes in which the data is actually decimal values.
In the user defined SQL (of oracle stage),i have casted these fields to NUMBER(p,s) datatype.
Eg: From database 'col' is NUMBER
I'm changing it to -- (CAST(col as NUMBER(31,11))
and when it is passed to the datastage by giving the target field data type as decimal(31,11) the below warning is throwing up in the oracle stage's data viewer.

When binding output interface field "col" to field "col": Implicit conversion from source type "decimal[38,10]" to result type "decimal[31,11]": Possible range limitation.
What could be the possible mistake?
Thanks and Regards!!
dspxlearn
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The warning is not from oracle but from DataStage.

Check the column formats within the job and in the stage mentioned by the warning.
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

Hi Sainath,
Thanks for the reply!

I am CASTing the datatype of fileds in the user defined sql of oracle stage.
Then passing the fields further by maintaining the target datatype as Decimal(31,11) as i did it in the sql.

The target fields datatype/length is same as what is used while Casting the fields in the oracle sql.
Thanks and Regards!!
dspxlearn
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If you run that sql from your favourite sql tool, does it work?
From a glance, it seems like the warning is due to the fact that your trying to fit a 38 length field in a 31 length field. Runt he same query from TOAD or sql developer and see if you get a smooth query.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The job has no idea you are CASTing the data in the query. Fix the metadata in the stage instead. You are allowed to change it when appropriate, ya know.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mpouet
Participant
Posts: 34
Joined: Mon Oct 18, 2004 10:23 am
Location: France

Post by mpouet »

Hi,

You describe a known bug. If you use a function in a user defined sql, decimal are seen as (38,10), and string fields are also with a length fixed by Datastage (I can't remember the length).
Just type your decimal as (38,10) and change when possible.

Matthieu
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

Thanks all.

DSguru,
The query is working fine in the sql tools(toad and sql navigator).

chulett,
Do you mean that pre CASTed sql in oracle stage will not be recognised by the job?

Matthieu,
I tried this but no luck.I got the below warning-
Column <col> floating point decimal is not fully supported; adjusting the scale.

If i have a field defined as NUMBER (no precision,no scale) in oracle database, what should be the default value to be given in datastage?
Thanks and Regards!!
dspxlearn
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

dspxlearn wrote:chulett,
Do you mean that pre CASTed sql in oracle stage will not be recognised by the job?
No. I just mean it won't know you've done that in the sql. It will still use the metadata to drive the warnings you are seeing.
dspxlearn also wrote:If i have a field defined as NUMBER (no precision,no scale) in oracle database, what should be the default value to be given in datastage?
Doesn't matter, you've seen what it defaults to. Based on your knowledge of the data, change the metadata in the stage to match rather than casting behind the scenes. If you think it should be Decimal(38,11) then make it Decimal(38,11) in the dang stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post by Havoc »

dspxlearn wrote: If i have a field defined as NUMBER (no precision,no scale) in oracle database, what should be the default value to be given in datastage?

I faced a similar issue... You just have to change the SQL Type in your stage to Decimal(38')'.. No need to mention the Scale. This should remove the warnings.
dspxlearn
Premium Member
Premium Member
Posts: 291
Joined: Sat Sep 10, 2005 1:26 am

Post by dspxlearn »

Hi Havoc,

I've tried this but warning was-
Implicit conversion from source type "decimal[38,10]" to result type "decimal[38,0]": Possible precision limitation.

I don't understand why it is showing "conversion from decimal(38,10)" .In the oracle database which is our soruce it is of NUMBER datatype(no precision).
Thanks and Regards!!
dspxlearn
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The "why" is that, when Oracle is interrogated as to data types, it returns DECIMAL(38,10) for unbounded NUMBER types.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

Ray, when we import the metadata through the oracle plug-in metadata import, every column in the table that has a NUMBER datatype defined is being brought over to DS metadata as decimal(38,10) and you have confirmed that..

but then from reading other topics related to this issue, i still dont get what should be done to overcome that, or rather to get rid of the warnings. I tried to manually change the column datatypes in the oracle enterprise stage, but it still throws the same error..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Edit the metadata post-import to get it right - to coincide with what your SQL is returning.

The warning is only an alert - it doesn't necessarily mean anything bad has happened - it's alerting you to the fact that you're (theoretically at least) trying to shoehorn a larger data type into a smaller, and therefore may limit the data values with which this would succeed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jreddy
Premium Member
Premium Member
Posts: 202
Joined: Tue Feb 03, 2004 5:09 pm

Post by jreddy »

Thanks Ray
Post Reply