Oracle query export into the Excel file

Hi,
How can i automatically export oracle query result into the excel file in oracle?

SQL and PL/SQL FAQ
Re: Excel query to Oracle Database
http://blog.mclaughlinsoftware.com/microsoft-excel/how-to-query-oracle-from-excel-2007/
Edited by: swapnil kambli on May 28, 2013 11:07 PM

Similar Messages

  • Time Stamp problem while writing data into the excel file

    Hii, All
                  I am taking the data from the DAQ card of the TOPSCCC with the 8 ms of scanrate for each channel and there are total 16 no of Analog channels in the Card, now i am acquiring the data from the card, time stamping it and writing it into the excel file, which is tab delimited, now the problem is, the data which are in the excel file have the same timestamp for 4 to 5 continuous records, instead we want each data with the different and continuous time stamp with same difference of time stamp between two records, mean if it is difference of 8 ms then it should be the 8 ms for all, but here it is taking the differnce of 16 ms for two samples and giving same time stamp for four to five records and that shouldn't happen, here i am attaching my vi, drivers for the cards and Excel file with the data, can you please give me any suggestion how to do it?
           Please help me i require this suggestion as early as possible, i am requiring it urgently.
    Thanks in Advance,
    Nishant
    Attachments:
    2026vi.llb ‏319 KB
    2026_ScanMultAD_Demo_time.vi ‏80 KB
    Data.xls ‏357 KB

    Hello Nishant,
    that's what I meant:
    Message Edited by GerdW on 05-16-2006 10:32 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    timestamp-array.png ‏2 KB

  • Problem in writing into the excel file using java code

    Hai ,
    I will be getting the data as a string and i am writing into the excel file. the problem is .if it has numeric values even now i will writing as a string data ,at this time i am getting the message in the excel file as "Number in the cell is formatted as text".
    I need to remove this thru my code..but i can write only as a string .
    To write in a excel file ,i used HSSFWorkbook.

    just check out
    http://www.andykhan.com/

  • Query Output Into a Text File

    Hello Experts,
    There is a situation where i need ur help.My query is :
    Can I export the output of more than one queries into a * Single Text File * ?
    Also can it be possible to automate these Queries Output to export into the Text File ??
    I also want this Text File Output to mail the end users by using the Process Chain. So is this possible to create a process chain for sending this Text File to the Users via mail ??
    Thanks In Advance
    Neha

    Hello Neha,
    Though i have been working with APDs since some time. But havent actually been involved in designing one. But you could find many documents for the APD on web. And as far as i know, you will need a program to save file from APD.
    I have a document which explains how you can use APD in  process chain. can forward you the same if you want.
    I am sorry as i wasnt of much help for you, as i havent worked on similar requirement before, but this thing just striked in my mind.
    Regards,
    Anuj

  • How to download a char(12) field into an excel file.

    Hi all,
    I have an internal table with a field defined as char 12. I pass this internal table to  FM MS_EXCEL_OLE_STAN DARD_DAT but I find in my excel file this value: 9,87654E+11.
    Any idea to obtain the correct value 987654321011?
    Thanks in advance for your kind support.
    Regards,
            Luigi

    Hi,
    this is my test.
    FM SAP_CONVERT_TO_XLS_FORMAT  and FM MS_EXCEL_OLE_STANDARD_DAT: the value in excel file is 9,87654E+11 launching both functions. If I try to resize the column, this value don't change. If I set as cell type (manually) number with zero decimals, this is ok.
    For may test I userd the field knvv-eikto.
    How it is possible to have this value downloaded correctly into the excel file?
    Thanks in advance for your kind support.
    Regards,
       Luigi

  • Writing into Excel file using PL/SQL and formatting the excel file

    Hi,
    I am writing into a excel file using PL/SQL and I want to make the first line bold on the excel. Also let me know if there are any other formatting options when writing into excel.
    Regards,
    -Anand

    I am writing into a excel file using PL/SQL
    Re: CSV into Oracle and Oracle into CSV
    check that thread or search in this forum...

  • Upload the excel file in oracle db through oracle forms

    Hi all,
    I want to upload the excel file in oracle db through oracle forms...I am new to oracle forms .
    I have searched a lot but not getting exact solution
    Is there anyone who will help me out with this .....
    Any help will be appriciated

    I'm trying to move data from excel into an Oracle forms field. This involves coping 2 columns of data cells in excel and pasting it into an Oracle forms field. I can get the date pasted into the Oracle forms field but there is a invisible character that separates the 2 columns of data coming from Excel. I do not know what this character is but it is causing the error 'Line 1 is invalid. Check forms'.
    Any ideas how to get pass this?
    Thank you

  • Exporting Data Quality Statistics Into An Excel File Or Database

    Hi,
               I would like to ask if it is possible to export the data profiling statistics into an excel file / flat file or a database table.
               The output required by our development team is that we would like to be able to manipulate and review the data profiling outside of the Data Quality Services User Interface.
              I'm aware that after the cleansing of a specific set of data is that you can save/export the output results into an excel file or database, however the feature I'm looking for is for the data profiling statistics itself.
     Mostly information on the knowledge base.  Specifically, how many new records this specific column has and how many unique data and invalid data this column has and etc.
              The reason for this is that so we can control and track the data profiling information and be a bit more flexible in creating reports and presenting the data.  Using the DQS user interface would not suit our needs
    for the project.   
               Sorry if this has been asked before but i've tried searching around and couldn't find any information regarding this functionality.
    Thanks!

    I'm not too sure where they are stored, but you could use the directories shown in transaction AL11 so find them.

  • Display the query result in an Excel file??

    hi there..
    am writing one script file that queries my DB and display the query result in an Excel file??
    i.e: if my query is :
    select col1, col2
    from table;
    and i want the results to dispalys in 2 col. in an Excel spreadsheet..
    Appreaciating ur cooperation..
    Mourad

    set colsep to a delimiter that is not normally part of your data like |
    also setup the environment with these other setup commands
    Set Echo Off;
    Set Concat Off;
    Set Pagesize 9999;
    Set Feedback Off;
    Set Verify Off;
    Set Term Off;
    Set Space 0;
    Set Colsep '|'
    Set Underline Off;
    If you wanted to use a comma delimiter the setup would be same but the set colsep='","'
    with the addition of concatenating a " on the first col and last col of the query
    eg.
    -- if first col and last_col are character types then
    SELECT '"'||col1,....,last_col||'"'
    FROM table;
    Otherwise if either is a number they would have to be converted with a TO_CHAR

  • Exported the JTable to excel  but to customize the excel file

    Hi,
    I have exported the JTable to excel through CSV file. But I want to customize the excel file, by setting border, color and cell styles. How to implement this? Can you please help me out?
    Thanks,
    public class CalculateUsers extends JPanel implements     ActionListener,     TableModelListener {
         JFrame frame;
         JTable table;
         public CalculateUsers(JPanel mainPanel) {
                    rows = new Vector();
              columns = new Vector();
              String[] columnNames = {"BP","users","Avg","time"};
              addColumns(columnNames);
              tabModel = new DefaultTableModel();
              tabModel.setDataVector(rows, columns);
              table = new JTable(tabModel);
              table.getModel().addTableModelListener(this);
              lblMessage = new JLabel("");
                 label1 = new JLabel("Textbox 1");
                    label2 = new JLabel("Textbox 2");
                    text1 = new JTextField(5);
              text2 = new JTextField(5);
              buttonPanel = new JPanel();
                        cmdAdd = new JButton("add");
                        cmdCalculate = new JButton("Calculate");
              cmdExportToExcel = new JButton("ExportToExcel");
                    buttonPanel.add(label1);
              buttonPanel.add(text1);
              buttonPanel.add(label2);
              buttonPanel.add(text2);
              buttonPanel.add(cmdCalculate);
              buttonPanel.add(cmdExportToExcel);
              buttonPanel.add(cmdAdd);
         public void addRow() { // Add Row
              Vector r = new Vector();
              r = createBlankElement();
              rows.addElement(r);
                    table.addNotify();
         public Vector createBlankElement() {
              Vector t = new Vector();
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
                 return t;
         public void calculate() throws Exception {
                int i = table.getRowCount();
                int firstCellVal, secondCellVal, thirdCellVal, fourthCellVal, fifthCell, sixthCell, sevenCell, eightCell,jtext1,jtext2;
               try{ 
                     tabModel.addColumn("Time taken");
                 tabModel.addColumn("Pse");
                 tabModel.addColumn("Users %");
                 tabModel.setColumnCount(7);
                    jtext1 = Integer.parseInt(text1.getText().toString().trim());
                    jtext2 = Integer.parseInt(text2.getText().toString().trim());
                  for (i = 0; i < table.getRowCount(); i++) {
                        String cell1 = table.getValueAt(i, 0).toString();
                        String cell2 = table.getValueAt(i, 1).toString();
                        String cell3 = table.getValueAt(i, 2).toString();
                        String cell4 = table.getValueAt(i, 3).toString();
                        sixthCell = secondCellVal * thirdCellVal * fourthCellVal;
                        sevenCell = ((jtext1 - (fourthCellVal * thirdCellVal))/(fourthCellVal - 1));
                        eightCell = (secondCellVal * 100)/jtext2;
                        table.setValueAt(result2, i, 4);
                        table.setValueAt(result3, i, 5);
                        table.setValueAt(result4, i, 6);
                } catch(Exception ae) {
                        ae.printStackTrace();
         public void actionPerformed(ActionEvent source) throws ArithmeticException { // ActionList
              if (source.getSource() == (JButton) cmdAdd) {
                        addRow();
              if (source.getSource() == (JButton) cmdCalculate) {
                          calculate();
              if (source.getSource() == (JButton) cmdExportToExcel) {
                         exportToExcel();
          private void exportToExcel() throws Exception{
                   exportTable();
         *public void exportTable() { // export Table*
    *          try {*
    *               System.out.println("Exporting Table ");*
    *               String filename = "ScenarioAutomation" + System.currentTimeMillis()+ ".CSV";*
    *               File file = new File(filename);*
    *               String data;*
    *               String columnNames[] = null;*
    *               columnNames = new String[table.getColumnCount()];*
    *               if (file != null) {*
                                *try {*
    *                    BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file, true));*
    *                    PrintWriter fileWriter = new PrintWriter(bufferedWriter);*
    *                    System.out.println("Column Headers ");*
    *                    firstRowInExcel(fileWriter);*
    *                    for (int j = 0; j < columnNames.length; j = j + 1) {*
    *                        columnNames[j] = table.getColumnModel().getColumn(j).getHeaderValue().toString();*
    *                        data = columnNames[j];*
    *                        System.out.println("data " + data);*
    *                        fileWriter.print(data + ",");*
                                   *     System.out.println("Done.... ");*
                                   *     fileWriter.println("");*
                                   *     System.out.println("Exporting Data ");*
    *                    for (int k = 0; k < table.getRowCount(); ++k) {*
                                        *for (int l = 0; l < table.getColumnCount(); ++l) {*
    *                         data = table.getValueAt(k, l).toString();*
    *                         fileWriter.print(data + ",");*
                                        *fileWriter.println("");*
    *                    fileWriter.close();*
    *                    System.out.println("Done.... ");*
    *                    System.out.println("File Name " + filename);*
    *                    open(file);*
    *                    } catch (Exception e) {*
                                        *JOptionPane.showMessageDialog(null, "Error " + e);*
    *          } catch (Exception E) {*
    *               System.out.println("Error While Exporting Table " + E);*
    *     private void firstRowInExcel(PrintWriter fileWriter) {*
                    *fileWriter.println("");*
    *          String jtext1label = ("Textbox 1");*
    *          fileWriter.print(jtext1label);*
    *          fileWriter.print(",");*
    *          String jtext1Value = text1.getText();*
    *          fileWriter.print(jtext1Value);*
    *          fileWriter.print(",");*
    *          fileWriter.print(" ");*
          *private void open(File f) {*
           *     String[] commands = {*
    *          "rundll32",*
    *          "url.dll,FileProtocolHandler",*
    *          f.getAbsolutePath()*
    *          try {*
                        *System.out.println("****OPEN file ****");*
                        *Runtime.getRuntime().exec(commands);*
    *          } catch (IOException e) {*
                        *e.printStackTrace();*
    *}*

    for this purpose you need to took help of the third party APIs.
    try POI from Apache
    http://poi.apache.org/hssf/index.html
    this is easy and efficent. and Free also.
    one more i found is
    http://es.actuate.com/xlsjbook/apibasics.html (Not sure about this one.)
    good luck go ahead

  • How to get the EXCEL file from web site (b2b) into SAP system?

    Hi Guys,
    I have a requirement of saving the excel file that has been send to SAP system from a B2B site.
    Currently there is a call to the SAP system from the B2B site via an RFC function ,this RFC functions gets the excel file as an input to the SAP system,i need to store this Excel file in the SAP  (as an excel file itself).
    How can i acheive this?
    Please suggest.
    Thanks ,
    Swati

    You can extract a date portion and  assign to the variable and then compare with GETDATE()
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to download values in an internal table into an excel file

    is there any fn module to download the values in an internal table into an excel file..

    hi
    the function module "GUI_DOWNLOAD"  downloads the data from
    an internal table into a file (can be xl, dat ,doc etc) .
    Plz follow the usage below ;
    Parameters : pa_pfile LIKE rlgrap-filename OBLIGATORY.
    Data : lv_filename TYPE STRING.
    lv_filename = pa_pfile.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                  =
         FILENAME                      = lv_filename
         FILETYPE                      = 'ASC'
       APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
       HEADER                        = '00'
       TRUNC_TRAILING_BLANKS         = ' '
       WRITE_LF                      = 'X'
       COL_SELECT                    = ' '
       COL_SELECT_MASK               = ' '
       DAT_MODE                      = ' '
       CONFIRM_OVERWRITE             = ' '
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       TABLES
         DATA_TAB                      = tb_download         " table data to b downlaoded
      EXCEPTIONS
        FILE_WRITE_ERROR              = 1
        NO_BATCH                      = 2
        GUI_REFUSE_FILETRANSFER       = 3
        INVALID_TYPE                  = 4
        NO_AUTHORITY                  = 5
        UNKNOWN_ERROR                 = 6
        HEADER_NOT_ALLOWED            = 7
        SEPARATOR_NOT_ALLOWED         = 8
        FILESIZE_NOT_ALLOWED          = 9
        HEADER_TOO_LONG               = 10
        DP_ERROR_CREATE               = 11
        DP_ERROR_SEND                 = 12
        DP_ERROR_WRITE                = 13
        UNKNOWN_DP_ERROR              = 14
        ACCESS_DENIED                 = 15
        DP_OUT_OF_MEMORY              = 16
        DISK_FULL                     = 17
        DP_TIMEOUT                    = 18
        FILE_NOT_FOUND                = 19
        DATAPROVIDER_EXCEPTION        = 20
        CONTROL_FLUSH_ERROR           = 21
        OTHERS                        = 22
    IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards
    Pankaj

  • Need to generate the excel file with diffrent sheets using utl_file package

    Hi,
    Sorry for previous message in which I had missed the usage of " UTL_FILE " package
    I need to generate the excel file with diffrent sheets . Currently I am generating the data in three diffrent excel files using
    " UTL_File " package and my requirement is to generate this in a single excel file with diffrent sheets.
    Please help on this
    Thanks & Regards,
    Krishna Vyavahare

    Hello 10866107,
    at Re: How to save a query result and export it to, say excell? you can find links to different solutions. At least the packages behind second and fourth link support more than one worksheet.
    Regards
    Marcus

  • Password Protection to the Excel File that was down loaded

    Hi Friends,
    I had an requirement regarding the excel file.whenever the excel file is down loaded on the desktop it should be password protected.i..e, no one should be able to open the file unless they have the password.

    REPORT ZWMI_TRUCK_DOWNLOAD no standard page heading.
    ======================================================================
    Program Name : ZWMI_TRUCK_DOWNLOAD                                   *
    Description  : This Program is used to get all truck load status     *
                   and download into XLS File and fields are Route #,    *
                   Dispatch time ,Closing time ,Scan Details.            *
    Author       : Seshu                                                 *
    Date         : 02/15/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    02/15/07| Seshu    | DEVK922058 | Initial                            *
    02/20/07| Seshu    | DEVK922068 | Changed the name as per Naming     *
                                      Convention                         *
    03/14/07| Seshu    | DEVK922126 | Included date as Range             *
    ======================================================================
    Tables
    tables : zsdcarton,
             ztruck,
             ztruckstatus.
    Constants
    constants: c_werks(4) type c value '1000'.
    Internal table for Ztruck
    data : begin of i_ztruck occurs 0,
           werks  like ztruck-werks," Plant
           vdatu like ztruck-vdatu, " Delivery date
           ZZTRKNO like ztruck-ZZTRKNO, " Route #
           ZZSHIPTIME like ztruck-ZZSHIPTIME, " Dispatch time
           ZCLTIME like ztruck-ZCLTIME, " Truck close time
           end of i_ztruck.
    Internal table for ZSDCARTON
    data : begin of i_zsdcarton occurs 0,
           lateflag like zsdcarton-lateflag,
           zzslot like zsdcarton-zzslot,
           status like zsdcarton-status,
           end of i_zsdcarton.
    Internal table for Final output
    data : begin of i_final occurs 0,
           vdatu like ztruck-vdatu, " Delivery Date
           ZZTRKNO like ztruck-ZZTRKNO, " Route #
           ZZSHIPTIME like ztruck-ZZSHIPTIME, " Dispatch time
           ZCLTIME like ztruck-ZCLTIME, " Truck close time
           load_compl_c(5)     type n , " Load Complted Time
           status_s_total(5) type n,  " No Scan/Load
           status_l_total(5) type n,  " Late Scan
           end of i_final.
    Internal Table XLS File Header
    DATA: BEGIN OF i_head OCCURS 0,
          field(30) TYPE c,
          END OF i_head.
    Variables
      status couter
    data: status_total(5)   type n,
      no scan / no load
          status_s(3)       type n,
          status_s_total(5) type n,
      good
          status_g(3)       type n,
          status_g_total(5) type n,
      late
          status_l(3)       type n,
          status_l_total(5) type n,
      manual
          status_m(3)       type n,
          status_m_total(5) type n,
      alternative
          status_a(3)       type n,
          status_a_total(5) type n.
    S E L E C T I O N    -   S C R E E N *************************
    selection-screen : begin of block blk with frame title text-001.
    select-options : p_vdatu for zsdcarton-vdatu obligatory
                    default sy-datum.
    selection-screen : end of block blk .
    S T A R T  -  O F  - S E L E C T I O N  ******************
    start-of-selection.
    Get the data from ZTRUCK and
      perform get_data_tables.
    Down load the data into XLS file
      perform get_download.
    S T A R T  -  O F  - S E L E C T I O N  ******************
    end-of-selection.
    *&      Form  get_data_tables
    FORM get_data_tables.
      data : lv_time like sy-uzeit.
      select werks
             vdatu
             zztrkno
             zzshiptime
             zcltime from ztruck into table i_ztruck
                                 where werks = c_werks
                                 and   vdatu in p_vdatu.
      if sy-subrc ne 0.
        message e000(zwave) with 'No data found for given current date'.
      endif.
      loop at i_ztruck.
        refresh : i_zsdcarton.
        clear :   i_zsdcarton,
                  lv_time.
    Get the Scan Status for Every route
        select lateflag zzslot status from zsdcarton into table i_zsdcarton
                               where werks =  i_ztruck-werks
                               and   vdatu = i_ztruck-vdatu
                               and   zztrkno = i_ztruck-zztrkno.
        if sy-subrc eq 0.
          loop at i_zsdcarton.
            case  i_zsdcarton-lateflag.
    late cartons
              when  'X'.
    late and never loaded
                if i_zsdcarton-zzslot = space.
                  add 1 to status_s.
                else.
                  add 1 to status_l.
                endif.
    all other exceptions
              when  space.
    check if scanned
                case i_zsdcarton-zzslot.
    good scan
                  when 'S'.
                    add 1 to status_g.
    never scanned
                  when space.
                    if i_zsdcarton-status = space.
    no scan
                      add 1 to status_s.
                    else.
    no load -> no scan
                      add 1 to status_s.
                    endif.
    manual scanned
                  when 'M'.
                    if i_zsdcarton-status = 'M'.
                      add 1 to status_g.
                    elseif i_zsdcarton-status = 'E'.
    exceprtion -> manual
                      add 1 to status_g.
                    endif.
                endcase.
            endcase.
    add totals
            add status_g   to  status_g_total.
          Late Scan
            add status_l   to  status_l_total.
            add status_a   to  status_a_total.
          No Scan and Load
            add status_s   to  status_s_total.
            clear : status_g,
                    status_l,
                    status_a,
                    status_s.
          endloop.
        else.
          continue.
        endif.
    Get the Load Complete Time
        select single uzeit from ztruckstatus into lv_time
                                       where   werks = i_ztruck-werks
                                       and     lgnum = '100'
                                       and     vdatu = i_ztruck-vdatu
                                       and     zztrkno = i_ztruck-zztrkno
                                       and     tstat = 'L'.
        if sy-subrc eq 0.
          write: lv_time(5)
                  to i_final-load_compl_c     using edit mask '__:__'.
        endif.
    Delivery Date
        i_final-vdatu = i_ztruck-vdatu.
    Route #
        i_final-zztrkno = i_ztruck-zztrkno.
    Dispach time
        i_final-zzshiptime = i_ztruck-zzshiptime.
    Truck Close Time
        i_final-zcltime = i_ztruck-zcltime.
    No Scan/ Load
        i_final-status_s_total = status_s_total .
    Late Scan
        i_final-status_l_total = status_l_total.
        append i_final.
        clear : status_g_total,
                status_l_total,
                status_a_total,
                status_s_total,
                lv_time,
                i_final.
      endloop.
    ENDFORM.                    " get_data_tables
    *&      Form  get_download
          Download the data
    FORM get_download.
      data : lv_file like rlgrap-filename,
             lv_date(8) type c.
      lv_date = sy-datum.
      concatenate 'C:/Truckload'  lv_date into lv_file.
    Fill the Header Values
    Delivery Date
      i_head-field = 'Delivery Date'.
      append i_head.
    Route #
      i_head-field = 'Route'.
      APPEND i_head.
    Dispatch Time
      i_head-field = 'Dispatch Time'.
      append i_head.
    Closing Time
      i_head-field = 'Closing Time'.
      append i_head.
    Load Completed Time
      i_head-field = 'Load Completed Time'.
      append i_head.
    No Scan/Load
      i_head-field = 'No Scan/Load'.
      append i_head.
    Late Scan
      i_head-field = 'Late Scan'.
      append i_head.
      CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          FILE_NAME                       = lv_file
      CREATE_PIVOT                    = 0
          DATA_SHEET_NAME                 = 'TruckLoad'
      PIVOT_SHEET_NAME                = ' '
      PASSWORD                        = ' '
      PASSWORD_OPTION                 = 0
       TABLES
      PIVOT_FIELD_TAB                 =
          DATA_TAB                        = i_final
          FIELDNAMES                      = i_head
       EXCEPTIONS
         FILE_NOT_EXIST                  = 1
         FILENAME_EXPECTED               = 2
         COMMUNICATION_ERROR             = 3
         OLE_OBJECT_METHOD_ERROR         = 4
         OLE_OBJECT_PROPERTY_ERROR       = 5
         INVALID_FILENAME                = 6
         INVALID_PIVOT_FIELDS            = 7
         DOWNLOAD_PROBLEM                = 8
         OTHERS                          = 9
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " get_download
    In function module you have option like password protect..

  • Any way to export table to excel file with leading 0s?

    I have to export about 50 excel files from different tables.  Some tables contain leading 0s in the columns.  If I use bcp to export to xls file, the leading 0s will be missing.  If bcp to csv or txt file, there will be no issue at all.  But I have to export to xls file in order to let client update that xls file and reload to tables again.
    Is there any other ways to do this task?
    Thanks in advance.

    Ok,  I played with it and fixed it on mine to work.
    Here is what you do.  Create a blank Excel file in Excel with a single header row with your column names in it, and then set the datatypes for each column in Excel to match your export type.  For the below, create an Excel file and in column A1, put "Name" and change the column to Type Text.  Then in B1 type Date and set it to type Date, then save the file as c:\Test.xls.  Then close the file in Excel.
    In SSMS execute the following:
    Code Snippet
    INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=C:\test.xls;HDR=YES',
    'SELECT Name, Date FROM [Sheet1$]')
    SELECT [Name], GETDATE() FROM msdb.dbo.sysjobs
    GO
     It worked perfectly in my environment.  Don't bother with BCP, just create a formated Excel File with a header row with your output column names and then save it.

Maybe you are looking for

  • DB_RUNRECOVERY error after just opening and closing a DB_ENV and DB

    Hi, I'm currently writing a bdb database maintanance utility for the OS project Netatalk which uses bdb for some data storage. We're using transactions and therefor we open DB_ENV with (DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT

  • How do I set up PSE13 to e-mail photos with Lotus Notes?

    How do I set up PSE13 to e-mail photos with Lotus Notes?

  • Uploading Photos in MySpace or Webshots.

    I have looked on your bulletin board - just don't see the answer I am looking for yet, so I will post a new TOPIC on this subject and see if it gets an answer I have a NEW iMac 10-5 leopard - but its not reacting correctly with two sites I use freque

  • Itpod touch screen turns blue and then white and wont turn on

    all of a sudden my screen went white and then blue and unable to turn on my ipod touch.Tried again and it started going black and red vertically . then the screen stays blue. have tried to restore 3 times know. nothing has worked?what wlse should i d

  • Two Different Phone Numbers

    It's not a serious problem but, When I phone someone my number ends in 5913 on their handset, but to phone me you have to dial 5914, 5914 is ment to be my actual number but when people try to phone me back on 5913 and the number isn't recognised... S