connector received Oracle error code ORA-1406

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
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

connector received Oracle error code ORA-1406

Post by aschindler »

Hi Team,
Derivation for one of the column in my oracle connector is as follows:
AVG( NVL(C1, 0) ) * AVG(
CASE WHEN C2 <= 0 THEN ABS(C2) ELSE 0 END )

When i run job,getting below error message:

While reading data for column COLUMN_NAME, the connector received Oracle error code ORA-1406. (CC_OraStatement::logArrayReturnCodes, file CC_OraStatement.cpp, line 4155)

Tried all the possible ways ,Please help in resolving this error.
Cheers,
Schindler
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What "all possible ways" have you tried?
-craig

"You can never have too many knives" -- Logan Nine Fingers
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

changed length as per target size and tried removing abs() function.
but still facing error.
Cheers,
Schindler
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What is the datatype / precision / scale of the column this will end up in? ABS() isn't part of the problem, btw.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

Thanks for instant reply,
Target column datatype: Decimal [38] [10]
Its not one to one mapping,doing some calculation in between.
Cheers,
Schindler
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Did you try using cast()? I think avg() returns double and you will have to use cast to make it decimal.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Wasn't asking about the "target" column as in the end state, I mean the column it will land in first, the one in your source stage. That's the one it is complaining about.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You should have your Oracle definition something like

Code: Select all

AVG( NVL(C1, 0) ) * AVG( CASE WHEN C2 <= 0 THEN ABS(C2) ELSE 0 END ) AS MyColumn
and use the name "MyColumn" in your source stage.
Last edited by ArndW on Tue Sep 17, 2013 3:53 am, edited 1 time in total.
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

Hi Chulett,

In oracle database column size is [20][4] Number.

ArndW,
Currently i am using like that only.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What it is in Oracle isn't the question, it might be if you were just selecting a column but you're not. Instead you are building a logical or derived column based on "C1" and "C2" with a mixture of functions so Oracle just assumes the worst and goes big.

Still trying to understand what data type and size you are using in the source stage for your "as MyColumn" field... not convinced that's been properly answered yet. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

but i doubt if we give derivation alias name and column in source stage with different names, it may through error.
MyColumn - MyNewColumn

Please elaborate.
Cheers,
Schindler
aschindler
Participant
Posts: 30
Joined: Wed May 15, 2013 1:22 am
Location: Bangalore

Post by aschindler »

Also in source oracle connector stage datatype is Decimal [38][10].
Cheers,
Schindler
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I corrected my code typo above. But it remains that you are creating a new column through your case and you need to know what that derived data type is. I just read that Craig has already suggested this. You might perform an explicit CAST() on this result and make sure you use the same definition in DataStage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just for grins, what does the error code mean? You can research this using the oerr -1406 command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's the dreaded "truncated during fetch" error, hence my questions.
-craig

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