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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


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