Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
query on db2 cursor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 149
Location: Coimbatore

PostPosted: Tue Nov 02, 2010 4:17 pm    Post subject: query on db2 cursor
Reply with quote

Hi,
I need some help in db2. I am updating a db2 table and for every 500 records insertion I am taking a checkpoint. Finally my program updated 25000 records. After that when I rerun the same program with my jcl it is showing -310 as the cursor was unable to open. I looked into the abend details to resolve it. But my db2 variables dint had any decimal values moving to non-decimal values. I gave display statements to check it but I am not able to find out where went the problem.

Could anybody please help me out to figure out the problem.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Tue Nov 02, 2010 4:50 pm    Post subject:
Reply with quote

Quote:
taking a checkpoint


meaning your program issues a COMMIT?

updated 25,000 ROWS - they were COMMITed?
(by the way, even though Personal Computer based databases use the terms fields and records,
on the mainframe, db2 tables have columns and rows.
Failure to following correct naming/word-usage standards leads to confusion.

If you received a -310 on an OPEN CURSOR, then you had non-decimal data in host variables.
no, do not argue about that. db2 does not make that mistake.
do yourself a favor and accept the fact,
that your host variables were populated with non-decimal data.

Does your program populate the host-variables prior to issuing the OPEN Cursor statement?
IF so, with what?
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 149
Location: Coimbatore

PostPosted: Tue Nov 02, 2010 4:59 pm    Post subject:
Reply with quote

yes they were committed.
But i am not moving any values to my host variables beore opening the cursor. i displayed all my host variables but it had only junk values in it and I really dont know from where it came. :-(
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 149
Location: Coimbatore

PostPosted: Tue Nov 02, 2010 5:00 pm    Post subject:
Reply with quote

when i initially ran it all my data were inserted correctly but when i ran the same jcl, actually it should not update anything or insert anything but it shows an abend with -310.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Nov 02, 2010 8:55 pm    Post subject:
Reply with quote

Hello,

Why did you not specify initial values for the host variables?

Quote:
i displayed all my host variables but it had only junk values in it and I really dont know from where it came.
The values are junk because you did not specify valid values. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 4 Tue Nov 07, 2017 8:34 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us