This content has been marked as final. Show 4 replies
I wouldn't use an undocumented function. You can use DBMS_SQL to retrieve colum names.1 person found this helpful
cur PLS_INTEGER := DBMS_SQL.open_cursor;
DBMS_SQL.parse (cur, 'SELECT * FROM EMP', DBMS_SQL.native);
DBMS_SQL.describe_columns (cur, ncols, cols);
FOR i IN 1 .. ncols
DBMS_OUTPUT.put_line (cols (i).col_name);
Official documentation at:
Thank you for your reply! Unfortunately this is not what I am searching for.
I want to update the interactive report definition on my apex page out of plsql.
E.g. the query of the IR on my page is: Select * from view_name
When i add/remove columns from the view, the IR is broken. In order to repair the IR I need to logon to apex, edit every IR and save it again. Afterwards the new columns will appear in the report.
Because my application has about 30 IR's and columns will change frequently I would like to script this step.
The function APEX_040100.wwv_flow_worksheet_standard.synch_report_columns sounds like it does exactly what I need.
Unfortunately what I tried doesn't work. (Look above)
you have to set the workspace you are synchronize the IR columns for:
DECLARE l_flow_id NUMBER (20); l_region_id NUMBER (20); l_query VARCHAR2 (4000); l_result VARCHAR2 (4000); BEGIN wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('<WORKSPACE_NAME>')); SELECT application_id, region_id, sql_query INTO l_flow_id, l_region_id, l_query FROM apex_application_page_ir WHERE page_id = 9 AND application_id = 133; APEX_040100.wwv_flow_worksheet_standard.synch_report_columns (p_flow_id => l_flow_id, p_region_id => l_region_id, p_query => l_query, p_add_new_cols_to_default_rpt => 'Y'); COMMIT; END;
That was the missing jigsaw piece!! Thank you very much!!