Fix sorting with dictionaries/Topic notes from eSword

Share your favorite tips, workarounds and shortcuts for theWord
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Fix sorting with dictionaries/Topic notes from eSword

Post by csterg »

This tip applies to the following bug:
'Dictionaries' and 'Topic Notes' imported from eSword with the importer before '0.99.3.42 - 17 Sep 2008' version will have the following problem: if you try to re-arrange the subjects the resulting order will not be correct.

Obviously, if you don't edit them (e.g. you leave them as imported, which is read-only) you will not see this problem.

Here is how to fix it:
From an sqlite program (e.g. sqliteExplorer http://www.singular.gr/sqlite/) run the following commands:

For dictionaries:

Code: Select all

create table x (rel_order integer primary key autoincrement, id, subject);
insert into x(id,subject) select id,subject from topics order by id;
update topics set rel_order = (select rel_order from x where id = topics.id);
drop table x; 
vacuum;
For 'Topic notes':

Code: Select all

create table x (rel_order integer primary key autoincrement, id, subject);
insert into x(id,subject) select id,subject from topics order by subject;
update topics set rel_order = (select rel_order from x where id = topics.id);
drop table x; 
vacuum;
Just copy/paste the above commands in sqliteExplorer's text box and hit 'Execute'. That's all.

Notice that you will probably never find this bug since (by default) all imported modules from eSword are non-user modules, e.g. they are not editable!

Costas