I try to get the SQL command behind the ir.
I'm using APEX 4.2.3 and OHS.
I followed the steps written by Denes Kubicek
but the region id is not accepted by the APEX_IR.GET_LAST_VIEWED_REPORT_ID function.
The simplified procedure is as follows:
DECLARE p_app_id NUMBER := 100; p_page_id NUMBER := 9; v_report_id NUMBER; v_region_id NUMBER; v_report apex_ir.t_report; v_query VARCHAR2 (32767); BEGIN SELECT region_id INTO v_region_id FROM apex_application_page_regions WHERE application_id = p_app_id AND page_id = p_page_id AND source_type = 'Interactive Report'; DBMS_OUTPUT.put_line ('Region: ' || TO_CHAR (v_region_id, '99999999999999999999')); v_report_id := APEX_IR.GET_LAST_VIEWED_REPORT_ID (p_page_id => p_page_id, p_region_id => v_region_id); DBMS_OUTPUT.put_line (v_query); EXCEPTION WHEN OTHERS THEN v_query := SQLERRM; DBMS_OUTPUT.put_line (v_query); END;
The v_region_id is correctly filled, I checked it also with Firebug,
but the GET_LAST_VIEWED_REPORT_ID command gives an error message.
The output is:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 354
ORA-06512: at "SYS.HTP", line 1368
ORA-06512: at "SYS.HTP", line 1443
ORA-06512: at "SYS.HTP", line 1735
ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 162
ORA-20987: Interactive report region does not exist in application , page 9 and region 22376302456333952.
The page is not public, I don't know whether it is related the problem you have.
Any help would be highly appreciated.