Page 1 of 1
Reorder Classification Nodes Alphabetically.
Posted: Sun Nov 07, 2010 9:29 am
by declan
I'd like my Tempo mode to be reordered alphabetically.
How do I do it?
Because of the number of items involved I can't do it manually, by dragging.
Re: Reorder Classification Nodes Alphabetically.
Posted: Sun Nov 07, 2010 10:07 am
by nohitter151
You can only drag and drop the items under the "Tempo" node in the tree to change the order.
Re: Reorder Classification Nodes Alphabetically.
Posted: Sun Nov 07, 2010 10:47 am
by Mizery_Made
Actually, you can achieve this "automatically" with Bex's SQL-Viewer script and an SQL statement.
Code: Select all
CREATE TEMP TABLE IF NOT EXISTS tmpSortClass (NewSortOrder INTEGER PRIMARY KEY AUTOINCREMENT, ListID INTEGER);
INSERT INTO tmpSortClass (ListID)
SELECT ID FROM Lists
WHERE IdListType IN (1) --1=Tempo, 2=Mood, 3=Occasion, 4=Quality
ORDER BY TextData COLLATE NOCASE;
UPDATE Lists SET SortOrder=(SELECT NewSortOrder FROM tmpSortClass WHERE ListID=ID)
WHERE ID IN (SELECT ListID FROM tmpSortClass);
Set the "WHERE IdListType IN ()" accordingly. Have run this multiple times on my database and have not seen any adverse effects. Though it's always recommended that you back up your database before tampering with it like this.
Re: Reorder Classification Nodes Alphabetically.
Posted: Sun Nov 07, 2010 11:43 am
by declan
Hi thanks for the reply. I'm afraid I don't quite understand.
I've downloaded Bex's script and installed it. If I select the SQL-Viewer from the list of scripts and paste the code it the box, what else do I need to do?
Re: Reorder Classification Nodes Alphabetically.
Posted: Sun Nov 07, 2010 6:55 pm
by Mizery_Made
Push the button that will "Execute" or "Run" it (or whatever the terminology is, I'm using a different version than the latest official release, so yours may be slightly different than mine).
Re: Reorder Classification Nodes Alphabetically.
Posted: Mon Nov 08, 2010 4:24 am
by declan
It has both a "Run" & "Execute" button, I've pressed both neither has had an effect.
Re: Reorder Classification Nodes Alphabetically.
Posted: Mon Nov 08, 2010 12:04 pm
by Mizery_Made
Attempting to run it in the version of SQL-Viewer I have, it throws an error (which is somewhat expected since mine is an old pre-release). You can try running it in
SQLiteSpy however. That's actually what I've always ran it in (though the program is useless for most other things other than simply viewing the database, due to MM's "IUNICODE" collating)