Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FDTable sort order doesn't match MariaDB, Avoid Duplicate Key Error


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0 Threads: [ Previous | Next ]
Michael Sawyer ...

Posts: 9
Registered: 9/10/17
FDTable sort order doesn't match MariaDB, Avoid Duplicate Key Error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 11, 2017 6:45 AM
Hello there,

We are currently testing out FDTables as a substitution for FDQuery, due to performance with big amount of data.
When sorting on another column other than the primary field, for example a char field, we are constantly getting the "Unique Key Violation" error.
I already followed the instruction given in [<Embarcadero Help - Browsing Tables>|http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Browsing_Tables_%28FireDAC%29] .
Didn't help very much.

I used following settings:

SortLocale := MAKELCID(MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
SortOptions := [soNoSymbols];
StrsTrim := false;

- "SortLocale" had a value of "1031", instead of Default "1024" -> No effect
- "[soNoSymbols]" did result in an instant error when opening the FDTable -> Worse
- "StrsTrim" -> No effect

As I comprehended, the main problem consists in sorting similar strings, which differ only in uppercase and lowercase AND
sorting "space" before special characters.
MariaDB is sorting space befor special characters, e.g. "-", which is totally familiar to us, but FireDAC is ordering the space char after special chars, which results in a Duplicate-Key-Error.

I didn't succeed setting the proper settings to our wished behaviour.

Have you had similar problems in sorting?
How did you manage this problem?
Is it possible to set up the FDTable in NO SORTING at all, rather just take the data as it receives them and display it?

Thank you.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02