Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to delete rows from a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
pratap v

New User


Joined: 21 Sep 2007
Posts: 2
Location: chennai

PostPosted: Tue Dec 04, 2007 5:27 pm    Post subject: how to delete rows from a table
Reply with quote

hi can any one explain how to delete say some 5 rows (or first 5 rows)
from table
is it possible by cusor

thanks
pratap
Back to top
View user's profile Send private message

Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Dec 04, 2007 5:52 pm    Post subject:
Reply with quote

Using positioned DELETE statements After your program has executed a FETCH statement to retrieve the current row, you can use a positioned DELETE statement to delete that row.
Example:
EXEC SQL DELETE FROM ORG.EMP WHERE CURRENT OF C1 END-EXEC.
Where C1 is the cursor.
And you can control 5 rows deletion in your program.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 04, 2007 9:11 pm    Post subject:
Reply with quote

Hello,

Quote:
can any one explain how to delete say some 5 rows (or first 5 rows)
Hopefully not. . .

What kind of business rule requires or even permits the arbitrary deletion of "some 5 rows"?

Quote:
is it possible by cusor

Yes, once the rules are defined, a cursor can be used to navigate through te rows.
Back to top
View user's profile Send private message
pratap v

New User


Joined: 21 Sep 2007
Posts: 2
Location: chennai

PostPosted: Wed Dec 05, 2007 11:07 pm    Post subject:
Reply with quote

thanks mr srihari and dick
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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us