Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Rename Categories

Quote Reply
Rename Categories
Is there any easy way to rename whole groups of categories?

For instance, say I want to rename every category that starts with:

Top/Music/local/bands/washington

to this:

Top/Music

Obviously every lower category would have to be renamed, and the links reorganized. Is this possible?

Thanks!

Katina

Quote Reply
Re: Rename Categories In reply to
You can issue a command in the SQL monitor to do that.

Basically, substitute 'Music/local/bands/washington' to 'Music'

First, check your category listings, and make sure that those are the categories that you want to change. If you make this change, you are not changing the number of the category, or the number of the category that the link is storing. So, no other changes will need to be made (other than a re-index and re-build).

UPDATE Category REPLACE (Name, 'Music/local/bands/washington', 'Music');


Make sure you have a recent backup so you can reinstall your category table if you need to.

The only thing this will change is the category table, so if it doesn't work, that's the only table you need to restore.

The change is immediate... so make sure it's what you mean.




Quote Reply
Re: Rename Categories In reply to
Excellent news! Thank you, Pugdog! :)))

Katina

Quote Reply
Re: Rename Categories In reply to
Pugdog,

I've been trying this, but continue to get the following error message in the SQL Monitor:

Query Error: You have an error in your SQL syntax near
'REPLACE (Name, 'Imported/Arts/Music', Name,
'Entertainment/Music');' at line 1

The command I am using is:
UPDATE Category REPLACE (Name, 'Imported/Arts/Music', 'Entertainment/Music');

I am trying to rename/reorganize categories Imported/Arts/Music to Entertainment/Music. What am I doing wrong?

Btw, do you know if the new version of Parse_RDF.pl was posted this week?

Thanks! :)
Katina

Quote Reply
Re: Rename Categories In reply to
Ok,

Too much late at night typing. Gotta tell the program where to stick it once it's done it. Try this:

UPDATE Category SET Name = REPLACE (Name, 'Imported/Arts/Music', 'Entertainment/Music');

That should work... again, you might want to try it on a test set of data first... either way, make sure you have a good back up, so you can go back to it if you need be <G>

As for updates... I get the feeling Alex worked himself to death, but no one's found the body yet (nothing in the Obit column anyway) <G>

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Rename Categories In reply to
Pugdog,

It worked great! You have NO idea how much work this saves me.. THANK YOU! :))

Wow, sounds like Alex has the world on his shoulders.. :( If I can do anything to help you guys out, please just say the word.. I'm a whiz with html/graphics and may be able to help out at that end.

Thanks again! :))
Katina