Attempt to convert String value error

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
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Attempt to convert String value error

Post 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?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What is the data type?
You are trying to insert data "BADDER" to Long type of field..
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post by bikan »

Yes,

I am trying to insert String into an integer column.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post 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)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply