View previous topic :: View next topic
|
Author |
Message |
sunil_chappy
New User
Joined: 19 Mar 2006 Posts: 9 Location: Bangalore, INDIA
|
|
|
|
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 |
|
|
T-REXDB2
New User
Joined: 28 Apr 2005 Posts: 11 Location: USA
|
|
|
|
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 |
|
|
|