• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Emptying a table but only by deleting a specified number of rows at a time

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I've got the problem where I need to empty a table (containing approx 360 000 rows) but I am only allowed to delete 50 000 rows at a time. It is an informix database and the table has no incrementing id.

Any help would be appreciated.

Thanks.
Kim
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What, and it won't just let you do this?:
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kim,

Maybe you could use some database-specific query using the rowid. I haven't used informix yet, but it would be something like

(of course, I assumed rowid starts with 1)
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the ROWID example of ORACLE.

ROWID
------------------
AAAL+ZAAEAAAAAdAAA
AAAL+ZAAEAAAAAdAAB
AAAL+ZAAEAAAAAdAAC
AAAL+ZAAEAAAAAdAAD
AAAL+ZAAEAAAAAdAAE
AAAL+ZAAEAAAAAdAAF
AAAL+ZAAEAAAAAdAAG
AAAL+ZAAEAAAAAdAAH
AAAL+ZAAEAAAAAdAAI
AAAL+ZAAEAAAAAdAAJ
AAAL+ZAAEAAAAAdAAK

 
Kim Lilienfeld
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all the help guys

Am gonna play around and see what works!

Thanks a million and 2..
K
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator





(of course, I assumed rowid starts with 1)



I think in Oracle it should be like

delete from your_table where rownum < 50001
[ October 19, 2004: Message edited by: Shailesh Chandra ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shailesh Chandra:

(of course, I assumed rowid starts with 1)<hr></blockquote>


I think in Oracle it should be like

delete from your_table where rownum < 50001
[/QB]



cent percent AGREEMENT
 
reply
    Bookmark Topic Watch Topic
  • New Topic