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
 
Regarding Update query in Cobol application Program

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

New User


Joined: 19 Mar 2006
Posts: 9
Location: Bangalore, INDIA

PostPosted: Sun Mar 19, 2006 2:52 am    Post subject: Regarding Update query in Cobol application Program
Reply with quote

Hi,
I am using only update sql in my cobol application program ( No count(*) , No READ sql there...no sql except UPDATE).......i wants to know according my where condition how many records are updated in table.
Back to top
View user's profile Send private message

T-REXDB2

New User


Joined: 28 Apr 2005
Posts: 11
Location: USA

PostPosted: Sun Mar 19, 2006 8:04 am    Post subject: Re: Regarding Update query in Cobol application Program
Reply with quote

sunil_chappy wrote:
Hi,
I am using only update sql in my cobol application program ( No count(*) , No READ sql there...no sql except UPDATE).......i wants to know according my where condition how many records are updated in table.


Dear Sir:

You must interrogate SQLCA after UPDATE SQL statement has successfully executed (i.e., SQLCODE = ZERO). Contents of SQLCA contains row count or number of updated rows.

In addition, you may also use the GET DIAGNOSTICS command to determine number of updated rows by previously executed UPDATE SQL statement. As follows:

GET DIAGNOSTICS EXAMPLE

BEGIN
DECLARE rcount INTEGER;
UPDATE CHECKING_ACCT
SET BALANCE = BALANCE * 1.5
WHERE ACCT_NO = hackednbr;
GET DIAGNOSTICS rcount = ROW_COUNT;
END

HOPE THIS HELPS, MUCHLY!! ;-]
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 10 Mon Dec 11, 2017 5:03 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm

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