View previous topic :: View next topic
|
Author |
Message |
neelima.sinha
New User
Joined: 14 Sep 2007 Posts: 30 Location: Bangalore
|
|
|
|
Hi,
I have a column in my table with data type as below
K_DEN DECIMAL(5,2)
while using in my cobol db2-program it is provided a corresponding data type of
ABC-K-DEN PIC S9(3)V9(2) USAGE COMP-3.
IN MY PROG I HAVE A CURSOR THAT SIMPLY SELECTS K_DEN FROM TABLE AND POPULATES IT INTO CORRESPONDING HOST VARIABLE
ABC-K-DEN.
in doing so it is failing with -304. the value in table was '+402.90' which i believe should be within the range.
can any body help on this please
regards,
Neelima SInha |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what is the DCLGENed cobol variable definition?
by the way, the error code is generated based on the possible size (range of values),
not the actual value.
yet another example why host variables should always be the DCLGENed variable
-
and not something dreamed-up by a coder that does not understand DB2 or bother to read the error descriptions |
|
Back to top |
|
|
Succor
New User
Joined: 20 Feb 2009 Posts: 96 Location: Bangalore :)
|
|
|
|
neelima.sinha,
The cobol varibale definition seems ok.Are you sure the error is being generated for this particular field.Can you post the cursor definition and fetched field definition with the actual error produced while execution. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
When receiving an unwanted SQLCODE, you should always display the contents of field SQLERRMC.
This field contains precious information related to the error.
In your case, it would tell you which column in your SELECT is "out-of-sync" with your INTO. |
|
Back to top |
|
|
|