View previous topic :: View next topic
|
Author |
Message |
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
There is a DECIMAL(6,0) db2 column whose cobol dclgen
variable is S9(6)V COMP-3. When trying to use update query on this column thru cob-db2 pgm, i get -310 sqlcode error.
I am taking the input from a CICS map variable declared PICIN=9(4). When i enter 0045 in the cics screen, the symbolic map variable 9(4) contains correct value 0045 only when displayed in the CEEMSG. I even tried moving the symbolic map variable to a temporary COMP-3 variable instead of the dclgen variable and used it as host variable in the update query, but still same prob.
Any solution to this? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you post the host variable defnition, the "temporary" variable definition, the problem sql statement, and the code to move the data from one place to the host variable (assuming this is an insert or update). |
|
Back to top |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
Map variable GAI PIC 9(04)
Screen Input
Host variable from DCLGEN
10 HV-GA PIC S9(6)V USAGE COMP-3.
Temporary variable
01 WS-TEMP PIC S9(06)V COMP-3.
MOVE GAI TO HV-GA
MOVE GAI TO WS-TEMP
EXEC SQL
UPDATE RESULTTB
SET GA = :WS-TEMP
WHERE ID = :HV-ID
END-EXEC.
I have used both HV-GA and also WS-TEMP as host variables. |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Can you show the 01 level of DCLGEN variable declaration. Did you try to display the host variable value before and after the update. |
|
Back to top |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
Another wierd observation,
There is another column CHAR(10) which we are updating using the query
Code: |
EXEC SQL
UPDATE RESULTTB
SET RESULT = 'GOOD'
WHERE ID = :HV-ID
END-EXEC.
|
Even this is giving the -310 error only. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Seems pretty obvious: HV_ID contains garbage. |
|
Back to top |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
And it seems pretty obvious that an assumption was made on HV-ID containing garbage. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Did you try to do any numeric test? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you post the value of :HV-ID in hex. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
Post subject: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DECIMAL DATA |
I wonder why people keep on questioning db2/sql judgement about what is <good> and what is <bad>
what is important is not what the TS thinks/believes but what DB2/SQL wants |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
vasif wrote: |
And it seems pretty obvious that an assumption was made on HV-ID containing garbage. |
Not really an assumption. It is an hypothesis based on the evidence presented. And a good one too. HV-ID is the next logical thing to check. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
So, to repeat:
Quote: |
Suggest you post the value of :HV-ID in hex. |
d |
|
Back to top |
|
|
|