truncation while inserting or updating in OCI stage

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
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

truncation while inserting or updating in OCI stage

Post by kollurianu »

Hi All,

I need a clarification , if length of the input field value exceeds the target field(oracle table) , then it was giving two warnings , finally the row is not inserted to the table and it is writted to the reject file.

So my question , here is if length exceeds then the record is not getting
inserted , by truncating , it being rejected does it happen so..


Thank you,
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I think the answer to that question is relative to the type of database. I have had this problem with UDB . The data would get truncated, throwing a warning message in the log file, and not get inserted. Maybe Oracle is works in the same way.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: truncation while inserting or updating in OCI stage

Post by rwierdsm »

Hi kollurianu,

I'm not working on Oracle at the moment, but I do recall that the OCI (Oracle) will try to convert, then if it's still not happy, it will reject.

This did seem to happen on strings that were too big for the target column. Oracle didn't seem to be happy with it's own truncate.

I would generally do a substring on the offending data to make sure it didn't exceed the target column length, send it through and only then would Oracle be happy.

Rob
Rob Wierdsma
Toronto, Canada
bartonbishop.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or Just ask the DBA to increase the length if its legitimate data. :twisted:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Post by rwierdsm »

DSguru2B wrote:Or Just ask the DBA to increase the length if its legitimate data. :twisted:
Yup, there is always the danger that your are 'hiding' bad data by taking my approach. Deadlines often limit investigation time into why data isn't what you expected, but the 'why' question should be asked!

Rob
Rob Wierdsma
Toronto, Canada
bartonbishop.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you don't want the warnings, you must include logic to reject the row before an attempt is made to send it to the database. For example if the column in question is Char(16) then you need something like

Code: Select all

Len(InLink.TheCoumn) <= 16
in a constraint expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Thanks for all the responses,


I understood , that will not load if the length exceeds , so far i was under
assumtion that it warns regarding the truncation and finally it would loaded, which is not happenning.

Hope i understood it in the rght way.

Thank you all once again....
Post Reply