Question about the question
Stew Ashton, July 20, 2022 - 8:18 am UTC
The question reads "I have a refcursor for select query and return some rows . similarly i need to update the fetched rows as flagged."
What do you mean by "return some rows"? Once a REF CURSOR is opened, you either fetch the rows yourself or you return the cursor to the caller, who then fetches the rows. To "return rows" you use a table function.
If you really mean to return the cursor so that the caller can do the fetching, there is no way to intercept the rows to update them. You would have to fetch the rows yourself and update them, as Chis explained in his answer, and then return the rows you fetched using a pipelined table function. However, you are not allowed to change the data within such a function!
If I am reading your question correctly, any possible solution would be unusual and perhaps dangerous.
July 20, 2022 - 1:52 pm UTC
Good points