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
 

 

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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am


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