IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding Update query in Cobol application Program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top