while passing smallint value to DB2 column getting negetive



IBM's flagship relational database management system

while passing smallint value to DB2 column getting negetive

Postby thotlma » Tue Jan 22, 2019 6:58 pm

Hi Everyone

i have defined column as BANK_NO SMALLINT in the one of the DB2 table
i have value 31 for BANK_NO POSITION(196:197) so after successfully completed the job
i have seen value -3087 in BANK_NO filed. could you please help me why iam getting this value in the table?
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: while passing smallint value to DB2 column getting neget

Postby Robert Sample » Tue Jan 22, 2019 7:28 pm

The hexadecimal value for -3087 is X'F3F1'. Guess what the zoned decimal value of 31 is? That's right, X'F3F1'. So you need to figure out how to convert zoned decimal to smallint when you load the value into DB2.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post