I just did a huge odp import and I was wondering how you can completely wipe out a category with all links and subcategories?
Mar 13, 2000, 7:26 PM
Veteran / Moderator (6956 posts)
Mar 13, 2000, 7:26 PM
Post #2 of 5
Views: 2112
This is probably best done in the SQL monitor with a command such as:
DELETE FROM Links where CategoryID=nn
And you can do a delete in the Categories table something like:
DELETE FROM Categories where Name RLIKE '^category_name/'
That should get rid of all the subcategories that begin with that top-level category.
You'll probably have to delete the top-level category youself, since it doesn't have the trailing '\'
You might want to try this on a test database before doing it for real....
You can also look in the FAQ for some hints and tips on the 'delete' commands, since this has come up before.
------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/
DELETE FROM Links where CategoryID=nn
And you can do a delete in the Categories table something like:
DELETE FROM Categories where Name RLIKE '^category_name/'
That should get rid of all the subcategories that begin with that top-level category.
You'll probably have to delete the top-level category youself, since it doesn't have the trailing '\'
You might want to try this on a test database before doing it for real....
You can also look in the FAQ for some hints and tips on the 'delete' commands, since this has come up before.
------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/
Mar 14, 2000, 12:32 AM
Veteran / Moderator (6956 posts)
Mar 14, 2000, 12:32 AM
Post #5 of 5
Views: 2118
There is only one MySQL book -- check the FAQ for the specifics .. it's in the PERL reference section.
SQL is a very, very broad thing, but this book gives you just about all you need to know to do what you have to do with Links.
Emptying the tables any way you want doesn't affect Links -- as long as you re-index and re-build once you do.
You can then check the lost links features of the Admin area to make sure you didn't lose anything.
The category table is "Category" ... I don't know why I typed Categories.... So, Links.Category should work.
You can always check the DEFS directory for a summary of what is going on in the MySQL database.... That gives a list of the tables Links uses, as well as the definitions Links is using for those tables.
NOTE: I said the "definitions Links is using for those tables." If you've made changes to the database outside of Links, the .def files might not really be what the database looks like..... That's the reason for resync (but resync loses all the weights and other defaults you've changed).
------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/
SQL is a very, very broad thing, but this book gives you just about all you need to know to do what you have to do with Links.
Emptying the tables any way you want doesn't affect Links -- as long as you re-index and re-build once you do.
You can then check the lost links features of the Admin area to make sure you didn't lose anything.
The category table is "Category" ... I don't know why I typed Categories.... So, Links.Category should work.
You can always check the DEFS directory for a summary of what is going on in the MySQL database.... That gives a list of the tables Links uses, as well as the definitions Links is using for those tables.
NOTE: I said the "definitions Links is using for those tables." If you've made changes to the database outside of Links, the .def files might not really be what the database looks like..... That's the reason for resync (but resync loses all the weights and other defaults you've changed).
------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/