I have to write a generic plsql function which is supposed to submit any concurrent request. For example, If the concurrent program has 5 parameters my function also should take 5 parameters as input. Like wise if the concurrent program has n number of parameters my function should take n number of input parameters. Can this be achieved? Please suggest the best way.
I tried manually with If statements like IF no of program parameters = 5, API should submit for the 5 input arguments only. But I know this is not the best way as we don't know which program end user may submit and how many parameters it has.
You can create a function that has multiple parameters and set them to "default null". Then just check if they are null or not.
Something like
Or you can make the function accept an array, like.
Or for a bit more flexibility have it accept a JSON array, that way you can pass a mixed use of scalar types.
Regards