• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AW: Delete a table content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: Delete a table content


  • Subject: AW: Delete a table content
  • From: Helge Staedtler <email@hidden>
  • Date: Mon, 05 Sep 2005 15:53:50 +0200

Title: AW: Delete a table content
Sorry, but what the heck is SQL?

You will just need this kind of machine-oriented-language if you use something like e.g.
http://wocode.com/cgi-bin/WebObjects/WOCode.woa/wa/ShareCodeItem?itemId=424

I would prefer to not write even ONE SQL-statement by hand as long as I can avoid it because I know that I make errors. EOF produces SQL using its own rules usually errorfree. If the performance is not enough for you, you should perhaps try to explain WHERE exactly you miss performance. I think deleting a Table is something that is clearly not the typical usage pattern of a database for a web-app. deleting rows, okay, but tables?

if your deletion of the table uses up too much time you could think about taking a WOLongResponse page for the time waiting until the stuff has finished. ;-)

just my 2 cents,
helge

Am 01.09.2005 14:53 Uhr schrieb "Fabrice Pipart" unter <email@hidden>:

Finlly I used "delete from TABLE_NAME".
And wow it IS 100 times faster than using EOs !

Great !
Thanks for the tip !

And this gave me an idea, why not do raw SQL updates when I have to update one field on a large data set?
And in fact it works, 100 times faster again.

But is there any drawback doing it this way?
Will the EOs I fetch after that, in sync with the database?
It seems that it is not the case :-(

Fabrice


On Aug 30, 2005, at 6:10 PM, Nathan Walker wrote:

I believe this is what you're looking for, Use this:

sqlSelect = "truncate table yourtablename";  // NOTE: I use TRUNCATE here to delete all rows AND RESET Auto-Increment Fields
EOUtilities.rawRowsForSQL(YourEC,"YourEOModelName",sqlSelect);

You could also use "delete table..." there too, but that does not reset any auto-increment fields if you have any...

That method is lightning FAST !


On Aug 30, 2005, at 8:06 AM, Fabrice Pipart wrote:

Hi list !

I have a question that seems rather simple :
is there a way to delete all the rows of a table without fetching all of them?
I have a table that is rather large and to avoid wasting a lot of memory I did not find a better way than using a fetchLimit and deleting each object until the table is empty...

Any idea?

Regards


Fabrice Pipart


www.icconsulting.mc

International Corporate Consulting
25, Boulevard de Belgique
MC - 98000 Monaco

T. +377 97982104 (direct)
F. +377 97708807
 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 


www.icconsulting.mc

International Corporate Consulting
25, Boulevard de Belgique
MC - 98000 Monaco

T. +377 97982104 (direct)
F. +377 97708807
 



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


--
Helge Städtler

- Expect and Respect.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Delete a table content (From: Fabrice Pipart <email@hidden>)

  • Prev by Date: Re: Delete a table content
  • Next by Date: Re: Flash and WebObjects...Make it Work with XML or other ?
  • Previous by thread: Re: AW: Delete a table content
  • Next by thread: Re: Flash and WebObjects...Make it Work with XML or other ?
  • Index(es):
    • Date
    • Thread