When call apex_util.get_print_document like this on apex.oracle.com
t_pdf := apex_util.get_print_document( p_report_data => t_xml , p_report_layout => t_xsl );
I get a ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_LOB", line 710
ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 10589
ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 11053
ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 11138
ORA-06512: at "APEX_040200.HTMLDB_UTIL", line 3255
ORA-06512: at line 32
That must be a bug, or not?
I've been unable to reproduce the error you've reported on apex.oracle.com, so would you mind placing a testcase on that instance and updating this thread with the workspace credentials so that we can take a closer look? Based on the snippet you've provided, it's unclear whether you're attempting to use signature 1 or 4 of the GET_PRINT_DOCUMENT API (see API documentation here), so any additional information you can provide would be helpful.
It turns out I was getting the error when using APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT instead of the original question use of APEX_UTIL.GET_PRINT_DOCUMENT.
I've put together an example: http://apex.oracle.com/pls/apex/f?p=37159:1
The bug is caused by the fact that my template was selected from a table. Copying it to a temporary clob solves the problem.
declare t_xml blob; t_pdf blob; t_xsl clob; t_xsl_ok clob; t_name varchar2(32767); begin select xml_data, name into t_xml, t_name from demo_xml where rowid = substr( apex_application.g_request, 8 ); select xsl into t_xsl from demo_xsl where id = 1; dbms_lob.createtemporary( t_xsl_ok, true ); dbms_lob.copy( t_xsl_ok, t_xsl, length( t_xsl ) ); t_pdf := apex_util.get_print_document( p_report_data => t_xml , p_report_layout => t_xsl_ok ); dbms_lob.freetemporary( t_xsl_ok ); end;