View previous topic :: View next topic
|
Author |
Message |
pratap v
New User
Joined: 21 Sep 2007 Posts: 2 Location: chennai
|
|
|
|
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 |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
pratap v
New User
Joined: 21 Sep 2007 Posts: 2 Location: chennai
|
|
|
|
thanks mr srihari and dick |
|
Back to top |
|
|
|