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,
truncation while inserting or updating in OCI stage
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
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.
-
- 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
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
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
Toronto, Canada
bartonbishop.com
-
- Premium Member
- Posts: 209
- Joined: Fri Jan 09, 2004 1:14 pm
- Location: Toronto, Canada
- Contact:
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!DSguru2B wrote:Or Just ask the DBA to increase the length if its legitimate data.
Rob
Rob Wierdsma
Toronto, Canada
bartonbishop.com
Toronto, Canada
bartonbishop.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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 in a constraint expression.
Code: Select all
Len(InLink.TheCoumn) <= 16
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.
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm