Decimals on Oracle

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
boligoma
Premium Member
Premium Member
Posts: 24
Joined: Tue Apr 24, 2007 3:07 pm

Decimals on Oracle

Post by boligoma »

Hi,

I'm having trouble in insert a decimal value from SQL 2005 to Oracle 10g. I'm using DS 7.5.1.A and ODBC as a connection.

The mistake is:
[DataStage][SQL Client][ODBC][Oracle][ODBC][Ora]ORA-01722: invalid number

the field property are the same: decimal with lengh 8 and scale 2.

Using the real and the fix functions on the transformer stage it enters all the numeric (without decimal) values. In fix I'm using 2 on the scale value.

Any help would be appreciated,
Ismael Martinez
Intellego SC
www.grupointellego.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Specify a reject link and analyze what records are the culprits. I am suspecting that your decimal field has more than just numbers.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
boligoma
Premium Member
Premium Member
Posts: 24
Joined: Tue Apr 24, 2007 3:07 pm

Post by boligoma »

Thanks for the quick answer. There are three records that are the culprits, this is one of them:

date(in decimal) = "25 07 86"
employeeid = 7499
custid = 104
orderid = 608
productid = 100871
quantity = 2
sales = 11.2

The charactersitics is that the sales field has a decimal value, the rest of the records are loaded quite fine. I'm using the fix(sales, 2,1) on the transformer.

Thanks in advanced,
Ismael Martinez
Intellego SC
www.grupointellego.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

sales column looks fine. Your first column "date" seems to be the culprit. Is that truely a date field? How are you converting that and whats your target column type?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
boligoma
Premium Member
Premium Member
Posts: 24
Joined: Tue Apr 24, 2007 3:07 pm

Post by boligoma »

I'm sorry about that... the "date" column is just a char with separate values, I had this problem before (of the timestamps) so I just wrote the dates in char's (separated with spaces) so I can transform it later.

The issue here is the sales column: it appears that the culprits the ones that has numbers at the right hand of the period. I don't know why...

Thanks,
Ismael Martinez
Intellego SC
www.grupointellego.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Try either of the following for the sales column

Code: Select all

Oconv(in.sales, "MR2")
OR
FMT(in.sales,"R2")
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply