Here is my object type
Create or replace type demo_obj is object (
Flag number,
Message varchar2(200))
Table of objects
Create or replace type obj_table is table of demo_obj
Next in function I write a cursor first fetches some id's Next i need to open cursor and check each I'd status with other table contains success or error status Of that I'd
If the cursor is empty i need to return flag as 0 and message null
If all the I'd"s are success o need to return flag 1 and message is concatenated string of all the IDs separated by commas
If few Ids are success and few are error i need to return flag 2 and message as the concatenated IDs which are error