Michaelactually we've a generic function that returns a table.i needed same functionality in a SQL am writing and thought i could use this function instead of duplicating same code.looks like i need to create a view here.

Could you concatenate all the ID values as a comma delimited list, and then pass that as a parameter to your function (and then have it split the list and JOIN that to whatever it is doing with the IDs)?