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
 

 

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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


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