Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 147
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: 6968
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: 147
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: 147
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 Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us