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: 135
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: 6966
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: 135
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: 135
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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