Datatype warnings from oracle!
Moderators: chulett, rschirm, roy
Datatype warnings from oracle!
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?
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
dspxlearn
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
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 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
dspxlearn
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.
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.
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?
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
dspxlearn
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 wrote:chulett,
Do you mean that pre CASTed sql in oracle stage will not be recognised by the job?
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.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?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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.
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).
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
dspxlearn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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..
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..
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.