UPDATE with ORDER BY stopped working

29 views
Skip to first unread message

Ivan

unread,
Mar 2, 2020, 5:51:10 PM3/2/20
to CodenameOne Discussions
Hi guys,
I have UPDATE sql statement with ORDER BY in my app and it stopped working (in simulator and in android device too)
Is there any change in DB implementation which can cause such a behavior?

This is my statement:
String[] params = new String[2];
            params[0] = iduser;
            params[1] = fsname;
db.execute("UPDATE TSUSET SET FMSETT = FMSETT + 1 WHERE (IDUSER = ? OR IDUSER = 'ALL') and FSNAME= ? ORDER BY CASE IDUSER WHEN 'ALL' THEN 2 ELSE 1 END LIMIT 1", params);

params are correctly entered

Previously it was working but now I'm getting error: syntax error near ORDER

Thanks

Shai Almog

unread,
Mar 2, 2020, 9:18:49 PM3/2/20
to CodenameOne Discussions
Hi,
we don't implement the DB. The SQL is sent directly to the native implementation and we didn't change the native implementation in the simulator.
Google might have updated sqlite with an OS update but we didn't.

Ivan

unread,
Mar 3, 2020, 3:57:58 AM3/3/20
to CodenameOne Discussions
hmm, that's strange then because when I attach to DB with sqlite client (DB Browser for SQLite) the statement runs without any problem 

Dňa utorok, 3. marca 2020 3:18:49 UTC+1 Shai Almog napísal(a):
Reply all
Reply to author
Forward
0 new messages