I’ve been at a customer developing a lot of custom menus based on portal security. Portal has a few views in it that sets up all of the page/component security for users that come in really handy. The problem is that each time the view is called it calls an external function to get the current user. This makes it a pain if you are trying to debug a statement in SQL*Plus. After a bunch of headaches I found that if I execute the statement execute WWCTX_API.SET_CONTEXT(‘{oid username}’,'{oid password}’);
I can execute queries agaist the WWSBR_ALL_FOLDERS and WWV_USER_CORNERS tables until my hearts content and get the information I need. Ahh…one less pain of dealing with portal and pl/sql, my day is complete.
BTW, the error I was getting is an ORA-06512, if your getting the same error number this might be the trick.