Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this:</p> <pre><code>declare doc_id pls_INTEGER:=0; sheet_id pls_INTEGER:=0; row_id pls_INTEGER:=0; begin doc_id := ora_excel.new_document; sheet_id := ora_excel.add_sheet('Sheet 1',doc_id); row_id := ora_excel.add_row; ora_excel.set_cell_value('A','Row1', doc_id,sheet_id, row_id); ora_excel.set_cell_value('B','Row1B', doc_id,sheet_id, row_id); row_id := ora_excel.add_row; ora_excel.set_cell_value('A','Row2',doc_id,sheet_id, row_id); ora_excel.set_cell_value('B','Row2B', doc_id,sheet_id, row_id); row_id := ora_excel.add_row; ora_excel.set_cell_value('A','Row3', doc_id,sheet_id, row_id); ora_excel.set_cell_value('B','Row3B', doc_id,sheet_id, row_id); ora_excel.save_to_file('FTP_FOLDER','excel.xlsx',doc_id); end; </code></pre> <p>Check this link: <a href="http://www.oraexcel.com/documentation/ORA_EXCEL.set_cell_value" rel="nofollow">http://www.oraexcel.com/documentation/ORA_EXCEL.set_cell_value</a></p> <p>If ColumnA and ColumnB are populated at different times and from different sources, but before you write the excel data to file, then this code might work:</p> <pre><code>DECLARE doc_id PLS_INTEGER:=0; sheet_id PLS_INTEGER:=0; row_id PLS_INTEGER:=0; v_idx PLS_INTEGER; TYPE t_rowids_t IS TABLE OF PLS_INTEGER INDEXED BY PLS_INTEGER; vt_rowids t_rowids_t; BEGIN doc_id := ora_excel.new_document; sheet_id := ora_excel.add_sheet('Sheet 1',doc_id); --select from first table row_id := ora_excel.add_row; vt_rowids(row_id) := row_id; ora_excel.set_cell_value('A','Row1', doc_id,sheet_id, row_id); row_id := ora_excel.add_row; vt_rowids(row_id) := row_id; ora_excel.set_cell_value('A','Row2',doc_id,sheet_id, row_id); row_id := ora_excel.add_row; vt_rowids(row_id) := row_id; ora_excel.set_cell_value('A','Row3', doc_id,sheet_id, row_id); --select from another table v_idx := vt_rowids.FIRST; WHILE v_idx IS NOT NULL LOOP ora_excel.set_cell_value('B','Row1B', doc_id,sheet_id, vt_rowids(v_idx)); ora_excel.set_cell_value('B','Row2B', doc_id,sheet_id, vt_rowids(v_idx)); ora_excel.set_cell_value('B','Row3B', doc_id,sheet_id, vt_rowids(v_idx)); v_idx := vt_rowids.NEXT(v_idx); END LOOP; ora_excel.save_to_file('FTP_FOLDER','excel.xlsx',doc_id); END; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload