SQL Problems with Parameters in "Order By"

GuyBooth

Active Member
Licensed User
Longtime User
Hello,
I have been trying unsuccessfully to use parameters for modifying the sort order in a SQL statement with B4A. as in the ParameterQueryExample sub in the attached code sample.



Reversing the sSortParameters makes no difference to the results.
The code in the WorkingQueryExample sub DOES work, so my basic syntax is correct (the actual query is far more comlex, I have simplified it here to make it clear) but I would prefer to use parameters for the sort order:


Can I do this using sort order parameters? I have tried all the variations I can think of …
 

Attachments

  • ParameterQueryExample.bas
    1.4 KB · Views: 181

keirS

Well-Known Member
Licensed User
Longtime User
SQLite does not support what you are trying to do. Parameters can only be used to replace literal values; not to replace identifiers.
 
Upvote 0
Top