View previous topic :: View next topic
|
Author |
Message |
Madhusmita Patnaik
New User
Joined: 18 Dec 2006 Posts: 14 Location: bangalore
|
|
|
|
When do we get a -406 abbend error? I think it is when there is a overflow in the table of a db2. Can neone pls explain me when we we have a overflow?Is it related to the PIC clause of variable while inserting data into tables? |
|
Back to top |
|
|
poul_motiram Currently Banned New User
Joined: 05 Dec 2006 Posts: 13 Location: chennai
|
|
|
|
Hi,
Errot -406 get when there is a data overflow occurs.
i.e. exceding the size of integer variable.
suppose SAL is declared as INTEGER while creating table.
its maximum size is 32767 & ur trying to store data
larger than its limit then u get -406 error.
Regards,
Motiram |
|
Back to top |
|
|
poul_motiram Currently Banned New User
Joined: 05 Dec 2006 Posts: 13 Location: chennai
|
|
|
|
hi
the max size for a small int column is 32767 and integer 's max value is 2147483647.
so when ever u try inserting a value which has a larger value than these u get a -406 abend code.
hope this satisfies your question. |
|
Back to top |
|
|
Madhusmita Patnaik
New User
Joined: 18 Dec 2006 Posts: 14 Location: bangalore
|
|
|
|
hey but i still want to clarify something. i have a situation.
a db2 table has a feild declared as integer. but its dcl gen declares the variable for this table with S9(9).
we have an workfeild with the pic as S9(9).
now we update that feild of the table with the value =feild value(s9(9))+workfeild(s9(9)).
here comes the overflow. can u suggest what could be the problem? |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
now we update that feild of the table with the value =feild value(s9(9))+workfeild(s9(9)).
here comes the overflow. can u suggest what could be the problem? |
Adding a 9 digit integer to a 9 digit integer may result in a number having more than 9 digits. Still any doubt on what could be the problem ??? |
|
Back to top |
|
|
Madhusmita Patnaik
New User
Joined: 18 Dec 2006 Posts: 14 Location: bangalore
|
|
|
|
i am really sorry for the question. I meant i need a solution for the problem. Can u suggest me as to what can be done to avoid this problem? |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Can u suggest me as to what can be done to avoid this problem? |
Truncation of added value from fieldvalue and workfield is not suggested, as you may be losing data here; so expanding DCLGEN field should be done instead.
As a functional/data owner of this program/process somebody has to decide on what value they need on the table in such cases, if they insist on having a full value (which is quiet natural) table field size should be increased. |
|
Back to top |
|
|
jamir Warnings : 1 New User
Joined: 04 Dec 2006 Posts: 1 Location: pune
|
|
|
|
when we get a error code -311
WARNING: START A NEW TOPIC |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Hi,
Madhusmita Patnaik wrote: |
hey but i still want to clarify something. i have a situation.
a db2 table has a feild declared as integer. but its dcl gen declares the variable for this table with S9(9).
we have an workfeild with the pic as S9(9).
now we update that feild of the table with the value =feild value(s9(9))+workfeild(s9(9)).
here comes the overflow. can u suggest what could be the problem? |
You need to define one more column for this as BIGINT
About BIGINT:
It is a 8-byte interger with 19 digits precesion.
But for this you need to contact the DBA and the client BA.
Quote: |
Can you give me the values in the two fields. |
As my assumption, to your query (First- Atop), I feel it is not with the S9(9) issue, it is the data into that field.
So it is defenetly a data check constraint issue.
Check the DDL for the table. |
|
Back to top |
|
|
|