I have a working procedure that outputs in a, what I would consider, scripting output using the DBMS_OUTPUT.put_line function.
The procedure works perfectly, but I can only view the results using the DBMS output line in my Toad system. I can transfer the data over to excel using a CSV, however this process takes some time and ideally I'd like to be able to only use excel in order to run the report.
I am very capable of running macros and have connected to my Oracle database before to run queries strictly from an Excel workbook. The issue becomes harvesting the DBMS output line format script response; I can only harvest the output in the "data grid" format- a table format, something like the output select * from table1.
My question then is, does Oracle have a way to output a collection in tabular format into the datagrid format from a procedure?
Here's an example of the procedure:
LOOP
SELECT (CAST (MULTISET (SELECT DECODE (mike.flg, '1', 'No Trailer', DECODE(mike.prod, '1', 'Waiting', mike.txt))
FROM ( SELECT *
FROM ( SELECT *
FROM hist
WHERE id = v_array.seq_id
AND txt IS NOT NULL
AND txt <> 'NOW'
AND flg = 1
ORDER BY id DESC) b WHERE ROWNUM <= 1 ORDER BY ROWNUM DESC) m) AS wbr.data_1_col_ty))
INTO v_col
FROM DUAL;
--select * from v_col;
IF v_col IS NOT NULL AND v_col.COUNT > 0
THEN
FOR v_index IN v_col.FIRST .. v_col.LAST
LOOP
DBMS_OUTPUT.put_line ();
END LOOP;
END IF;
END LOOP;
I'd like to be able to output the results from v_col in tabular format as I go or all at once at the very end of the procedure. I know v_array.seq_id gets matched up within the loop, but is there a way to output in tabular format at the end? Being able to do this should allow me to call this script through Excel Macro's and harvest the results.
v_coldefined?