Re: [sqlite] Binding an order by

2017-10-05 Thread Stephen Chrzanowski
Interesting idea, and one for the books, but, in this case, the sort order is complicated by nothing being fixed. The primary sort concern is whether I'm grouping priorities of the tickets together or not. If grouped, the priority order is considered first [ order by Priority=0,Priority, ]. If I

Re: [sqlite] Binding an order by

2017-10-05 Thread Simon Slavin
On 5 Oct 2017, at 7:59pm, Stephen Chrzanowski wrote: > No. The user (Me) can only select the order through popups, not by > entering a string. I understand the concern, but, depending on what the > user selects, the code will generate the string based on the users click. Very good. Simon. _

Re: [sqlite] Binding an order by

2017-10-05 Thread Jim Morris
What you may be able to do is to use a case statement(s) which uses a bound variable to either a column or dummy E.g order by case orderControlValue = 1 then column1 else "" end, ... On 10/5/2017 11:51 AM, Igor Tandetnik wrote: On 10/5/2017 2:45 PM, Stephen Chrzanowski wrote: Given the quer

Re: [sqlite] Binding an order by

2017-10-05 Thread Stephen Chrzanowski
No. The user (Me) can only select the order through popups, not by entering a string. I understand the concern, but, depending on what the user selects, the code will generate the string based on the users click. On Thu, Oct 5, 2017 at 2:52 PM, Simon Slavin wrote: > > > It looks like you need

Re: [sqlite] Binding an order by

2017-10-05 Thread Simon Slavin
On 5 Oct 2017, at 7:45pm, Stephen Chrzanowski wrote: > I wanted to bind :OrderBy with field names and conditions based on user > preferences Binding is to values, not to column names. If you have one ORDER BY parameter, you can only bind it to a value. If you want a WHERE parameter you cann

Re: [sqlite] Binding an order by

2017-10-05 Thread Stephen Chrzanowski
That's all I needed to know. Thanks. On Thu, Oct 5, 2017 at 2:52 PM, Gwendal Roué wrote: > > > Le 5 oct. 2017 à 20:45, Stephen Chrzanowski a > écrit : > > > > Given the query: > > > > select EventID, Airline, ContactInfo,TicketID,CreateDate from tEvents > where > > Resolved=:Resolved order by

Re: [sqlite] Binding an order by

2017-10-05 Thread Gwendal Roué
> Le 5 oct. 2017 à 20:45, Stephen Chrzanowski a écrit : > > Given the query: > > select EventID, Airline, ContactInfo,TicketID,CreateDate from tEvents where > Resolved=:Resolved order by :OrderBy > > I wanted to bind :OrderBy with field names and conditions based on user > preferences, but I t

Re: [sqlite] Binding an order by

2017-10-05 Thread Igor Tandetnik
On 10/5/2017 2:45 PM, Stephen Chrzanowski wrote: Given the query: select EventID, Airline, ContactInfo,TicketID,CreateDate from tEvents where Resolved=:Resolved order by :OrderBy I wanted to bind :OrderBy with field names You can't. A bound parameter can only appear where a literal is allowe

[sqlite] Binding an order by

2017-10-05 Thread Stephen Chrzanowski
Given the query: select EventID, Airline, ContactInfo,TicketID,CreateDate from tEvents where Resolved=:Resolved order by :OrderBy I wanted to bind :OrderBy with field names and conditions based on user preferences, but I think the bind converted my order rules into a string and ordered my results