Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Bulk delete

Quote Reply
Bulk delete
How to delete a greater number of links.

For example: I want to delete all links which was added and not modified older than 6 month ago.

Michael

--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Michael Skaide] Bulk delete In reply to
Use the SQL Monitor


DELETE FROM Links_Links WHERE (TO_DAYS(NOW()) - TO_DAYS(Add_Date) <= 180) AND (TO_DAYS(NOW()) - TO_DAYS(Mod_Date) <= 180)


May need some tweaking, but I think you get the idea...
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Bulk delete In reply to
>> May need some tweaking

To that end, when debugging _ALWAYS_ use "SELECT" rather than "DELETE" when testing the query. It's a _LOT_ safer :)

When the SELECT query returns the records you think it should, you can replace it with DELETE.






PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Michael Skaide] Bulk delete In reply to
Hi,

You can also use the admin to do this. Go to Delete->search, enter in your date and choose less then. Then set max hits at the bottom to 500 or 1000 and do your search. It will take a while to display all the links, but at the very bottom is a checkbox to check all links. Check that and hit delete.

If you do do the SQL method, you will need to delete the id's out of the CatLinks table too.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Bulk delete In reply to
Out of curiosity, shouldn't REPAIR TABLES take this into account?

Point out links that have no category as well as Cat_Links that have been orphaned either by CatID or LinkID ?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Bulk delete In reply to
It only does one way (links not in a category). It should probably do both. =)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Bulk delete In reply to
Thanks Alex,

Hmmhh, I did not remember this solution. :(

Michael

--
Michael Skaide

http://www.cycle24.de