Posts

Showing posts from March, 2019

How to extract PLSQL query data to an Excel file from Oracle Database

DECLARE    output utl_file.file_type;     v_data  varchar2(20000);     v_file_path varchar2(100); BEGIN    output := utl_file.fopen('/data/test/DEV/excel'                                           ,'Test.xls'                                           ,'w'                                            ,32000);               owa_sylk.show(p_file  => output                                       ,p_query => 'SELECT msi.organization_id                                                               ,msi.segment1 item_number                                                               ,msi.description item_description                                                            FROM inv.mtl_system_items_b msi                                                            WHERE msi.organization_id = :org_id'                      ,p_parm_names  => owa_sylk.owasylkarray('org_id')                      ,p_parm_values => owa_sylk.owasylka