Page 1 of 1

Attempt to convert String value error

Posted: Thu Jan 25, 2007 3:52 am
by bikan
I am getting the following error when i use DB2/UDB stage.

"Attempt to convert String value "BADDER" to Long type unsuccessful"

The row is getting inserted into the target table with a NULL value in the target column. Is there any way i can stop this and make DB2/UDB stage reject the record so that i can catch this record as a part of the reject records.

For the same table if i use ODBC stage, the row is getting rejected and i am able to capture the rejects. Is there any work around where i can custoimize the properties of DB2 stage?

Posted: Thu Jan 25, 2007 5:47 am
by kumar_s
What is the data type?
You are trying to insert data "BADDER" to Long type of field..

Posted: Thu Jan 25, 2007 6:03 am
by bikan
Yes,

I am trying to insert String into an integer column.

Posted: Thu Jan 25, 2007 6:26 am
by chulett
So... since your question is actually about capturing it as a reject from the DB2/UDB stage... you recognise the fact that you can't 'insert string into an integer column', yes?

What happened when you setup a reject link from the transformer feeding the database and tried to capture that error as a reject? What constraint did you use? What did - or did not - work?

Posted: Thu Jan 25, 2007 3:02 pm
by ray.wurlod
It is not legitimate to want to insert a string into an integer column. Why do you want to do this? What integer would you hope to get?

Posted: Fri Jan 26, 2007 2:07 am
by bikan
Gurus,

I am just trying to cleanse data and i would like to capture all the rows that is not getting inserted in the target database. One example i am trying is to insert a varchar type into the integer column.

I capture the reject records/Filtered records in the transformer using the following


Filtered Records
<LinkName>.REJECTEDCODE = DSE.NOERROR AND <LinkName>.REJECTED

Reject Records
<LinkName>.REJECTEDCODE

The whole intention behind me trying this is I need to basically differentiate filtered valid records(dosen't meet the constraint) and Rejected records(rejected due to some errors). (This is for Audit puporse)

Posted: Fri Jan 26, 2007 5:16 am
by ray.wurlod
Use two separate Transformer stages. It's easier to understand, and you don't need to muck about with expressions. The first traps your business rule rejects; the second traps database rejects.