4

HI,

I want to delete all ItemNames in single query in simpledb. whether it's possible in simple db.If possible please give the query for deleting all items in simple DB

Thanks senthil

Senthil
  • 61
  • 1
  • 5

3 Answers3

8

SimpleDB doesn't have any way to delete multiple records with a single query, and there is no equivalent to 'TRUNCATE TABLE'.

Your options are either to delete records one at a time or to delete the entire domain.

Scrappydog
  • 2,864
  • 1
  • 21
  • 23
6

Use the DeleteDomain operation to delete an entire domain. You can re-create the domain using CreateDomain afterward.

4

SimpleDB supports batch delete now: http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API_BatchDeleteAttributes.html

But you can only do 25 at a time.

If you want to delete the entire domain, do as Scrappydog suggest and delete the domain. Much faster than deleting one by one.

Travis Reeder
  • 38,611
  • 12
  • 87
  • 87
  • Travis, the API says that AttrName and AttrValue are "required" -- I don't understand how to make batched delete queries with just item names. Any pointers? – Riyad Kalla May 06 '11 at 16:42