Page 1 of 1

truncation while inserting or updating in OCI stage

Posted: Wed Jun 07, 2006 8:25 am
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,

Posted: Wed Jun 07, 2006 8:28 am
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.

Re: truncation while inserting or updating in OCI stage

Posted: Wed Jun 07, 2006 8:57 am
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

Posted: Wed Jun 07, 2006 9:08 am
by DSguru2B
Or Just ask the DBA to increase the length if its legitimate data. :twisted:

Posted: Wed Jun 07, 2006 9:16 am
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

Posted: Wed Jun 07, 2006 3:44 pm
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.

Posted: Thu Jun 08, 2006 8:31 am
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....