Loading error in DB2

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kalpanam
Participant
Posts: 39
Joined: Sat Apr 19, 2008 6:14 am

Loading error in DB2

Post by kalpanam »

Hi,

I'm loading cust_key column value with bigint datatype to db2 database.but NULL values are getting load into the table.while i tried to load the same cust_key column to dataset,values are getting loaded correct.

Not knowing why the NULL values are getting loaded into the db2 database.

Could any one please let me know where the issue is?

Thanks & Regards,
Kalpana.
Kalpana Marupudi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is the column nullable in datastage? What is the data type of the target DB2 column?
kalpanam
Participant
Posts: 39
Joined: Sat Apr 19, 2008 6:14 am

Post by kalpanam »

ArndW wrote:Is the column nullable in datastage? What is the data type of the target DB2 column? ...
Hi ,

The column is nullable in datastage and the datatype in DB2 is "INTEGER".

Thanks & Regards,
Kalpana.
Kalpana Marupudi
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post by mobashshar »

Hi Kalpana,
The data is loading properly in DataSet but not in DB2 table. It will work in Dataset when you copy the input link into dataset output link in which case both will have the same datatype as bigint.
Maybe you are trying to push the BigInt datatype into Int column in DB2.
Check it and let us know.
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

While the data is loading into DB2,convert it to Integer in query by cast function...
thanks n regards
nani
kalpanam
Participant
Posts: 39
Joined: Sat Apr 19, 2008 6:14 am

Post by kalpanam »

mobashshar wrote:Hi Kalpana,
The data is loading properly in DataSet but not in DB2 table. It will work in Dataset when you copy the input link into dataset output link in which case both will have the same datatype as bigint.
Maybe you are trying to push the BigInt datatype into Int column in DB2.
Check it and let us know.

Thanks for your reply,

DB2 stage column is defined as nullable and in DB2 database also column is defined as nullable.

We are actually getting the column value from a dataset which is defined as VarChar using modify stages we converted to In32 using the following functions
decimal_from_string and nt32_from_decimal

After using decimal_from_string conversion function,I'm using Trimleadingtrailing() function.Can I use this function for decimal value?

Don't know where I'm really wrong..Please help
Kalpana Marupudi
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post by mobashshar »

Hi Kalpana,
No. you can only use trimleadingtrailing for varchar if I am not mistaken.. since your target DB2 column is integer as you mentioned earlier and your source is varchar.. try converting the varchar to Int and try loading again.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

As has been stated above, you are getting NULLs in your target because the converion from string to numeric in DataStage is failing on certain values. Do an explicit conversion in DataStage and you'll find out which values are causing you problems.
Post Reply