1. Beatrix Willius
  2. Valentina Database ADK
  3. Mittwoch, Dezember 13 2017, 01:25 PM
  4.  Abonnieren via E-Mail
I have a field where I'm now using numeric collation. But I usually sort with the result of a function that uses this field. But the function doesn't do the numeric collation anymore.

Data:
Inbox
Something
Import-1
....
Import-13
Sent
Other Stuff

The function

CREATE OR REPLACE FUNCTION PathSort(thePath STRING) RETURNS STRING BEGIN CASE WHEN LOWER(list_nthitem(thePath, 1, ':::')) = 'inbox' THEN RETURN concat('1:', REPLACE(thePath, ':::', chr(10))); WHEN LOWER(list_nthitem(thePath, 1, ':::')) = 'sent' THEN RETURN concat('2:', REPLACE(thePath, ':::', chr(10))); WHEN LOWER(list_nthitem(thePath, 1, ':::')) = 'sent messages' THEN RETURN concat('2:', REPLACE(thePath, ':::', chr(10))); WHEN thePath = 'Trash' THEN RETURN concat('7:', REPLACE(thePath, ':::',chr(10))); WHEN thePath = 'Spam' THEN RETURN concat('3:', REPLACE(thePath, ':::', chr(10))); WHEN LOWER(list_nthitem(thePath, 1, ':::')) = 'views' THEN RETURN concat('4:',REPLACE(thePath, ':::', chr(10))); WHEN LOWER(list_nthitem(thePath, 1, ':::')) = 'Mailboxes' THEN RETURN concat('5:', REPLACE(thePath, ':::', chr(10))); ELSE RETURN concat('6:', REPLACE(thePath, ':::', chr(10))); END CASE END


is used to sort

Inbox
Sent
other mailboxes

(simplified). If I sort the result of the function with


select RecID, MailboxPath, WhereClause, PathSort(MailboxPath) from mailbox order by 4


I get

Import-1
Import-10
Import-2

and so on. Bug or feature?

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
I would call it a feature. Look, your function produces a string and you call it in select list to be a cursor column. This column is created as a string field with default set of attributes. If you need to change some attributes you should create some calculated field in the table and change attributes there.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Hi Ivan,

yes, makes sense. Thanks!

Mit freundlichen Grüßen/Regards

Beatrix Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories