Reorder Classification Nodes Alphabetically.

Publicar una respuesta

Emoticonos
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode está habilitado
[img] está habilitado
[url] está habilitado
Emoticonos están habilitados

Revisión de tema
   

Expandir vista Revisión de tema: Reorder Classification Nodes Alphabetically.

Re: Reorder Classification Nodes Alphabetically.

por Mizery_Made » Lun Nov 08, 2010 12:04 pm

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)

Re: Reorder Classification Nodes Alphabetically.

por declan » Lun Nov 08, 2010 4:24 am

It has both a "Run" & "Execute" button, I've pressed both neither has had an effect.

Re: Reorder Classification Nodes Alphabetically.

por Mizery_Made » Dom Nov 07, 2010 6:55 pm

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.

por declan » Dom Nov 07, 2010 11:43 am

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.

por Mizery_Made » Dom Nov 07, 2010 10:47 am

Actually, you can achieve this "automatically" with Bex's SQL-Viewer script and an SQL statement.

Código: Seleccionar todo

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.

por nohitter151 » Dom Nov 07, 2010 10:07 am

You can only drag and drop the items under the "Tempo" node in the tree to change the order.

Reorder Classification Nodes Alphabetically.

por declan » Dom Nov 07, 2010 9:29 am

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.

Arriba