Thanks PAVB.
Same script and same function are running good in other 3 environments and it was good in the environment where is it problematic now. No changes have been made from DB side since quite a long time.
This script and function are the inbuilt code by Oracle (for ASAP application) and no one modify the code in it. More over the function has few delete blocks in it and returns some value. Not too complicated function.
I have just analyzed all the objects in the schema and I am going to drop / create the function with the code from the other environment.
Though it sounds silly, but i have very few options to fix this issue.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.