Insertion of a BIGINT value in DB2
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 9
- Joined: Wed Nov 17, 2004 11:35 pm
Insertion of a BIGINT value in DB2
Hi,
I have been trying to insert an 11 digit number having datatype BIGINT(19) in DB2. But instead of the actual value it inserts some random number . Can u suggest a solution for this?
Regards,
Sonal.
I have been trying to insert an 11 digit number having datatype BIGINT(19) in DB2. But instead of the actual value it inserts some random number . Can u suggest a solution for this?
Regards,
Sonal.
Good morning Sonal,
a bigint (64-bit) has enough "room" for 11-digit integers; so I would ask (a) if you get random results redirecting output to a sequential file and (b) which method and stage are you using to insert into DB/2 and is the bigint(19) the DS definition or the DB/2 definition?
Also, if you have valid values for this column in Db/2 already, can you read it correctly through DataStage?
a bigint (64-bit) has enough "room" for 11-digit integers; so I would ask (a) if you get random results redirecting output to a sequential file and (b) which method and stage are you using to insert into DB/2 and is the bigint(19) the DS definition or the DB/2 definition?
Also, if you have valid values for this column in Db/2 already, can you read it correctly through DataStage?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 9
- Joined: Wed Nov 17, 2004 11:35 pm
Hi,
I am trying to insert Bigint in DB2 through UDB DB2 stage. The design is something like this:
The data we are inserting is DB2 stage is further sent to Seq. File. In seq file this 11 digit value comes as actual no. But in DB2 stage inserted value is magic no. which is 2147483647. In the database this field is defined as BigInt.
I am trying to insert Bigint in DB2 through UDB DB2 stage. The design is something like this:
Code: Select all
-----------> Xformer--------->Seq. File
|
|
DB2
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 9
- Joined: Wed Nov 17, 2004 11:35 pm
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 9
- Joined: Wed Nov 17, 2004 11:35 pm
Very true Shrinivas.
Size for int is 32 so 2^(32-1) is this magic value i.e. 2147483647.
But BigInt size is 64 Bit. So why this DS is truncating and making it 32 for storing purpose in DB2. In fact in Seq file this value is properly stored and displayed. But in case of Db2 stage it is truncating it and making it to 2^(32-1)
Size for int is 32 so 2^(32-1) is this magic value i.e. 2147483647.
But BigInt size is 64 Bit. So why this DS is truncating and making it 32 for storing purpose in DB2. In fact in Seq file this value is properly stored and displayed. But in case of Db2 stage it is truncating it and making it to 2^(32-1)
Sainath.Srinivasan wrote:31 (max bits used for a 32 bit value)
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 108
- Joined: Mon Oct 21, 2002 8:30 am