I have a Oracle SQL function, which returns a bunch of records through various sub-queries. However, there are countless filters that can be applied to these result records.
In an application programming language, I'd be able to abstract away the filtering behavior by allowing a function parameter to my function i.e. a callback in JS or Functional Interface object in Java.
Another possibility is having optional parameters or function overloading, but it still isn't scalable in regards to different filtering demands. Also, it won't work on stored procedures or functions.
I'm new to writing SQL procedures and functions, so I'm wondering is there any other option besides using an application programming language?