This content has been marked as final. Show 6 replies
There are two variables here: "FALSE" and the workspace ID. Off the top of my head, I'm guessing workspace ID can't be found where you are trying to do this. You say VM and Internal DB. Are these two different workspaces? Is this in the same workspace that where other execution of the code worked?
declare v_clob CLOB; begin v_clob := apex_040200.wwv_flow_utilities.export_workspace_to_clob ( p_workspace_id => 2626323717160271 , p_include_team_development => FALSE); end;
What do you think?
Yeah as I said it is a real workspace ID, I checked it, doublechecked it and triplechecked it.
I did not try it with the same workspace no, just a random workspace from the other DB.
I can't seem to figure out why one works, and one doesn't. The workspace is a normal workspace with developers, applications, team dev,...
The export application to clob function works fine on both btw.
it is a real workspace ID, I checked it, doublechecked it and triplechecked it.Just to be sure, what I was trying to ask was: "It's a real workspace ID ... for THE workspace you are exporting from?"
If it can't seem to find this ID, one reason would be it's not the "right" workspace. As a test, does it throw the same error if you use ID 999999999999999999999? Maybe it can't "see" this workspace or maybe it can't "see" any workspaces.
You always find something in the last place you look.
Yes it's a real workspace id, but I guess your right not to take my word for it, see for yourself:
I tracked down the problem a little bit more. The reason it worked on the other DB was because I tested it there in the Apex schema. And on the VM on my local schema. On the Apex of my VM it does work, it also works when I give in a fake workspace id btw, then it just creates a clob that tries to create an empty workspace with that ID.
I also tried out all other export methods in my own schema, and they all work. The only one that doesn't is this function and the procedure export_workspace. I granted myself the APEX_ADMINISTRATOR_ROLE aswell, and ofc I got execute rights on the package wwv_flow_utilities.
I experienced that very same error in an APEX 4.2 environment when trying to execute the "export_workspace_to_clob" function. Never had this error on my 4.1.1 instance though. I'm pretty sure you need something extra in your code to cope with security and user context. These security measures are only necessary for the workspace export.
More information can be found here: http://apexplained.wordpress.com/2012/03/20/workspace-application-and-page-export-in-plsql/
wwv_flow_api.set_security_group_id(2626323717160271); -- set the apex_application.g_user global variable... -- the username you use as argument needs admin privileges in the workspace apex_custom_auth.set_user('admin');
I'm afraid, however, that these extra lines of code will not solve your issue. I never succeeded in resolving the above error :`(
Actually this worked for me thanks for the link Nick!
declare l_clob CLOB; BEGIN wwv_flow_api.set_security_group_id(2626323717160271); apex_custom_auth.set_user('admin'); l_clob := wwv_flow_utilities.export_workspace_to_clob(p_workspace_id => 2626323717160271 , p_include_team_development => FALSE); end;