in sql data blocks you can now indicate conditionals in the form:
--IF=:sort
ORDER BY my_col
--END
The downside is that the IF test only implements null vs not null distinctions. It would be better for sorting conditionals etc to be able to specify case statements in this form:
--SWITCH=:sort
--CASE=code
ORDER BY code
--CASE=total
ORDER BY total
--ELSE
ORDER BY NAME
--END
This would mean that if sort pased a value of code it would sort by the code column, but if it passed a value of total it would sort by the total column, otherwise it would sort by the name column.
Comments
Comment #1
metzlerd commentedHere's a patch for this.
Comment #2
metzlerd commentedCommitted to both dev branches.