
January 16th, 2013, 04:43 AM
|
|
Registered User
|
|
Join Date: Jan 2013
Location: Pretoria, South Africa
Posts: 3
Time spent in forums: 44 m 52 sec
Reputation Power: 0
|
|
|
Cursor
Try this:
BEGIN NOT ATOMIC
FOR REC AS C1 CURSOR WITH HOLD FOR
SELECT 'TEST' col1,
ROW_NUMBER() OVER() as ROWNUM
FROM TABLE
DO
DELETE FROM TABLE WHERE PKEY = COL1;--
IF MOD(ROWNUM,10000) = 0 THEN commit;--
end if;--
END FOR;--
commit;--
END;
Quote: | Originally Posted by anaveens Is there any BEST way to delete set of records at a time using cursors?
DB2 Version = 7.2.5 on AIX
Embedded SQL on C++ |
|