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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 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


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