View previous topic :: View next topic |
Author |
Message |
jagfit Beginner
Joined: 27 Sep 2003 Posts: 5 Topics: 2
|
Posted: Fri Nov 14, 2003 5:27 am Post subject: SQL to delete 'N' number of records |
|
|
Hi ,
I need to delete 'N' number of records from a table. Other than using the cursor and deleting , is there any other way out ? For example, like Oracle's ROWNUM , is anything similar avaiable in DB2 ? Or is there any other method available(functions etc) ? Please note that I need to delete the records through program only. So I cannot use unload or any option like that.
Thanks, _________________ Regards,
Jagfit |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Nov 14, 2003 6:42 am Post subject: |
|
|
Jagfit,
why do you need a cursor to delete? A simple delete statement with proper where clause will do. Db2 version & supports Rownum. rownum must be a column in your table.
Hope this helps...
cheers
kolusu |
|
Back to top |
|
 |
jagfit Beginner
Joined: 27 Sep 2003 Posts: 5 Topics: 2
|
Posted: Fri Nov 14, 2003 8:24 am Post subject: |
|
|
Kolusu,
Thanks for the pointer..Did you mean DB2 Version 7 ? Also , can you point me to a manual which describes ROWNUM ? I searched,but could not locate it..
Thanks, _________________ Regards,
Jagfit |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
jagfit Beginner
Joined: 27 Sep 2003 Posts: 5 Topics: 2
|
Posted: Fri Nov 14, 2003 8:53 am Post subject: |
|
|
Thanks Kolusu. I will go through these. _________________ Regards,
Jagfit |
|
Back to top |
|
 |
|
|