I need to enter value for direction of sort in a function, but how to do it?
Tried like that, but this doesn’t work of course.
create or replace function invest_ideas
(order_by_direction varchar default 'desc')
create or replace function invest_ideas
(order_by_direction RECORD default desc)
in query line looks like that:
order by creation_time order_by_direction
2
Answers
You can do:
For a life test see: DBFIDDLE
Use dynamic SQL with format: