How to insert records into an Excel file

i was wondering if anyone knows how to insert records from a pl/sql block straight into an excel file

try with spool or UTL_FILE...
Re: CSV into Oracle and Oracle into CSV
SQL> spool c:\test1.csv
SQL> select substr(str,2,length(str)-3) from (select regexp_replace(column_value,'\s*<[^>]*>[^>]*>',',') str from table(xmlsequence(cursor(select * from test_emp))));
SUBSTR(STR,2,LENGTH(STR)-3)
9999,fredi&apos;s,CLERK,2345,10-OCT-06,1250,123,20
4567,STEWART,ANALYST,3456,02-APR-07,3200,215,30
2345,Cockrel,CLERK,7566,23-JAN-82,800,30
3 rows selected.
SQL> spool off;

Similar Messages

  • How to save data into an excel file ?

    I am working on using computer to corol HP8510 Network Analyzer System. Firstlly, I save my data into a notepad.Now I want to save them directly into an excel file. Is there anybody can give me any clue?
    Thanks
    Attachments:
    S.vi ‏165 KB

    The attached zip file contains several VI's to read and write directly to Excel using ActiveX. There are several example VI showing how to use everything. This set is saved in LabVIEW 6.0.2.
    I suggest you unzip these to your user.lib directory so you'll be able to easily access them from the functions palette.
    I have not actually used these, but others that have say they have worked well for them.
    Good Luck
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    excel_lv6i.zip ‏898 KB

  • How to insert records into the Table?

    Dear Sir,
    I'm new to JDeveloper. Now I managed to create a Frame in JDeveloper with many Text fields and a button. In the back end, I have a procedure to insert records to a table, to which I pass the values of the fields as parameters. Now I'm not getting the steps to call the PL/SQL Stored procedure when I click on the button. I'm using Oracle 9i JDeveloper version 9.0.3.1. and Oracle 9i Database.
    Please give me the complete steps to achieve my task - it is quite urgent.
    Thanking You in advance.
    Regards,
    Senthil .A. Perumal.

    The JDBC tutorial will show you how to call a stored procedure from Java:
    http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/basic.htm
    One more thing, why are you using such an old version of JDeveloper? any reason not to upgrade to the 10.1.3 version of JDeveloper?
    Also you might want to look into ADF and how it makes these type of database interactions easier.
    See this demo:
    http://www.oracle.com/technology/obe/obe1013jdev/adf_swing/master_detail_page_adfswing_bc.htm

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to Load the data from excel file(Extension is .CSV) into the temp.table

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Hello Sachin,
    You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
    Instead of copy values into forms you can save them in your temporary table.
    Kind regards,
    Alex
    If someone's helpful or correct please mark it accordingly.

  • How to load the data from excel file into temprory table in Forms 11g?

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Declare
        v_full_filename         varchar2(500);
        v_server_path           varchar2(2000);
        v_separator             VARCHAR2(1);
        v_filename              VARCHAR2(400);
        filename                VARCHAR2 (100);
        v_stop_load             varchar2 (2000);
        v_rec_error_log         varchar2(4000);
        v_error_log             varchar2(4000);
        ctr                     NUMBER (12);
        cols                    NUMBER (2);
        btn                     number;
        RES                     BOOLEAN;   
        application             ole2.obj_type;
        workbooks               ole2.obj_type;
        workbook                ole2.obj_type;
        worksheets              ole2.obj_type;
        worksheet               ole2.obj_type;
        cell                    ole2.obj_type;
        cellType                ole2.OBJ_TYPE;
        args                    ole2.obj_type;
        PROCEDURE olearg
        IS
        args   ole2.obj_type;
        BEGIN
        args := ole2.create_arglist;
        ole2.add_arg (args, ctr);                                
        ole2.add_arg (args, cols);                                   
        cell := ole2.get_obj_property (worksheet, 'Cells', args);
        ole2.destroy_arglist (args);
        END;
    BEGIN
    v_full_filename := client_get_file_name(directory_name => null
                                     ,file_name      => null
                                     ,file_filter    => 'Excel  files (*.xls)|*.xls|'  
                                                                            ||'Excel  files (*.xlsx)|*.xlsx|'                                                                 
                                     ,message        => 'Choose Excel file'
                                     ,dialog_type    => null
                                     ,select_file    => null
    If v_full_filename is not null Then
    v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
    v_filename := v_separator||v_full_filename ;
    :LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);                                
    RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));     
    --Begin load data from EXCEL
    BEGIN
        filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
        application := ole2.create_obj ('Excel.Application');
        ole2.set_property (application, 'Visible', 'false');
        workbooks := ole2.get_obj_property (application, 'Workbooks');
        args := ole2.create_arglist;
        ole2.add_arg (args, filename); -- file path and name
        workbook := ole2.get_obj_property(workbooks,'Open',args);
        ole2.destroy_arglist (args);
        args := ole2.create_arglist;
        ole2.add_arg (args, 'Sheet1');
        worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
        ole2.destroy_arglist (args);
        ctr := 2;                                                     --row number
        cols := 1;                                                -- column number
        go_block('xxx');
        FIRST_RECORD;  
        LOOP       
                --Column 1 VALUE --------------------------------------------------------------------
            olearg;
            v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            :item1 := v_stop_load;
            cols := cols + 1;                                                      
              --Column 2 VALUE --------------------------------------------------------------------
            olearg;
            :item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            cols := cols + 1;
            --<and so on>
        ole2.invoke (application, 'Quit');
        ole2.RELEASE_OBJ (cell);
        ole2.RELEASE_OBJ (worksheet);
        ole2.RELEASE_OBJ (worksheets);
        ole2.RELEASE_OBJ (workbook);
        ole2.RELEASE_OBJ (workbooks);
        ole2.RELEASE_OBJ (application);
    END;
    --End load data from EXCELPlease mark it as answered if you helped.

  • How  to load the data from excel  file  into table in oracle using UTL_FI

    How to load the data from excel file into table in oracle
    and from table to excel file
    using UTL_FILE package
    Please give me some example

    This is something i tried in oracle apex
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    Regards,
    CKLP

  • How to write a data type into an excel file?

    Hi everyone,
    What I am trying to do is to get some data from MS SQL then write into an excel file.
    stmtExcel.executeUpdate("Insert into [Output$] (CustomerID, ProductID, [Date], OrderQty) Values(" + rsSQL.getInt("CustomerID") + ", " + rsSQL.getInt("ProductID") + ", '" + (rsSQL.getString("Date")).substring(0,10) + "', " + rsSQL.getInt("OrderQty") + ")");
    There is no problem to write into an excel file, however, after all data is imported, excel sheet treats the the integers or dates as Text format. The funny part is, after I double click one of the cells with an integer value, that cell's format will be changed to integer, same thing happens with the date type.
    I am wondering if there is any way I can write an integer or whatever type into an excel file, which excel can recognize their own types instead of Text format. Thank you so much in advance.
    Sincerely,

    Yes, use an API that supports such things, like Andy
    Khan's JExcel:
    http://www.andykhan.com/
    %Thanks, duffymo. I haven't tried it yet, but according to the website, it seems that is possible! thanks again!

  • On Adobe Acrobat Pro, how do I take a PDF file and convert it into an excel file?

    I am not sure how to take a PDF file and change it into an excel file. I have Adobe Acrobat Pro. Thanks!

    Using Acrobat XI Pro.
    File - Save As Other - Spreadsheet - Microsoft Excel Workbook
    Be well...

  • 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

  • File To RFC Scenario- simply insert records into ztab

    Hi
    i have a requirment, where XI gets a flatfile and needs to map to RFC function module and then inserts records into ztable in SAP system. it doesn't require any response back.
    proble here is:
    i don't want to get RFC 'Response mesage' when i import RFC into XI IR. i require only 'Request message'.
    please help me, how to create a RFC function module with out Response message, and it should contain only Request message.
    i have created RFC in this way:
    RFC doesn't vcontains neither import nor export parameters. and i have defined on table in TABLE tab which refers to a ztable created already.
    Thanks in advance..
    Regards,
    Rajesh

    Thankx Michal,
    I have written ZRFC this way:
    insert ZMM_AUTO_GR from INPUT_TABLE .
      if sy-subrc = 0.
        commit work.
      else.
       rollback work.
    im not using neither import nor export parameters..but using only tables parameters. but when imported in XI im getting same table  structure in both request an response.
    please suggest what changes required in above code to invoke my ZRFC in async way.
    you will not get any response in XI- what chages required in my code to dnt get .reponse in XI.
    appreciate your help.
    Regards,
    Rajesh.

  • 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

  • How do you save data into an excel file while myRIO is acquiring data? I tried saving it using "Write to file" but it doesn't work for some reason.

    I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
    Thank you for your help.

    Hi Ssheoran,
    Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

  • How to load data from MS Excel file

    Hello All,
    Please help me regarding:
    how to load data/ insert records from MS Excel spreadsheet into Oracle table without converting that MS Excel file into CSV.
    Thank You in advance.

    Vivek More wrote:
    how to load data/ insert records from MS Excel spreadsheet into Oracle table without converting that MS Excel file into CSV.Setup HS connectivity:
    1. Create ODBC SYSTEM DSN using Microsift Excel driver(xls) and select your excel file as workbook.
    2. Create file initXLS.ora in %ORACLE_HOME%\hs\admin directory contailing the following line:
    HS_FDS_CONNECT_INFO = XLS3. Modify listener.ora file in %ORACLE_HOME%\network\admin directory and add the following lines to SID_LIST under SID_LIST_LISTENER
        (SID_DESC =
          (SID_NAME = XLS)
          (ORACLE_HOME = your-oracle-home)
          (PROGRAM = hsodbc)
        )4. Modify tnsnames.ora file in %ORACLE_HOME%\network\admin directory and add the following lines:
    XLS =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SID = XLS)
        (HS=OK)
      )5. Restart listener.
    6. Create database link (public or private depending on your needs):
    CREATE PUBLIC DATABASE LINK XLS USING 'XLS';7. Now you are all set. For example my file has:
    NAME
    SAM
    JOEDefault sheet name "Sheet1$" is treated as table name (Since excel is case sensitive you need to use quoted name). First row is treated as column name. And select:
    SQL> select * from "Sheet1$"@xls;
    NAME
    SAM
    JOE
    SQL> Now if you do not know excel sheet names you can issue (I renamed excel sheet Sheet1$ to Names$):
    SQL> select table_name from all_tables@xls;
    TABLE_NAME
    Names$
    Sheet2$
    Sheet3$
    SQL> select column_name from all_tab_columns@xls where table_name = 'Names$';
    COLUMN_NAME
    NAME
    SQL> SY.

  • Servlet inserting record into postgresql through hibernate

    Hi
    I have developed a servlet. This servlet is inserting record into postgres sql through hibernate using eclispe ide. When I run my code then I find the following exception
    exception
    java.lang.NullPointerException
         hibernate.example.FirstExample.doGet(FirstExample.java:54)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    I have developed the following code
    package hibernate.example;
    public class Contact {
         private String firstName;
         private String lastName;
         private String email;
         private long id;
         public String getEmail() {
         return email;
         public String getFirstName() {
         return firstName;
         public String getLastName() {
         return lastName;
         public void setEmail(String string) {
         email = string;
         public void setFirstName(String string) {
         firstName = string;
         public void setLastName(String string) {
         lastName = string;
         public long getId() {
         return id;
         public void setId(long l) {
         id = l;
    **Now the servlet is**
    package hibernate.example;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    public class FirstExample extends HttpServlet     {
         Session session = null;
         public String getServletInfo() {
              return "Servlet connects to PostgreSQL database and displays result of a SELECT";
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
              try{
                   response.setContentType("text/html");
                   PrintWriter out = response.getWriter();
                   Configuration cfg = new Configuration().configure();
                   SessionFactory factory = cfg.buildSessionFactory();
                   session = factory.openSession();
                   out.println("Inserting Record");
                   Contact contact = new Contact();
                   contact.setId(6);
                   contact.setFirstName("Deepak");
                   contact.setLastName("Kumar");
                   contact.setEmail("[email protected]");
                   session.save(contact);
                   out.println("Done");
              catch(Exception e){
                   System.err.println(e.getMessage());
              finally{
                   session.flush();
                   session.close();
    **web.xml is**
    <web-app>
              <database>
                   <driver>
                   <type>org.postgresql.Driver</type>
              <url>jdbc:postgresql://127.0.0.1:5432/ali</url>
              <user>ali</user>
              <password>ali</password>
                   </driver>
              </database>
              <servlet>
              <servlet-name>FirstExample</servlet-name>
              <servlet-class>hibernate.example.FirstExample</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>FirstExample</servlet-name>
              <url-pattern>/hb</url-pattern>
              </servlet-mapping>
    </web-app>
    **And contact.hbm.xml is**
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="hibernate.example.Contact" table="CONTACT">
    <id name="id" type="long" column="ID" >
    <generator class="assigned"/>
    </id>
    <property name="firstName">
    <column name="FIRSTNAME" />
    </property>
    <property name="lastName">
    <column name="LASTNAME"/>
    </property>
    <property name="email">
    <column name="EMAIL"/>
    </property>
    </class>
    </hibernate-mapping>
    **And hibernate.cfg.xml is**
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory>
    <property name="hibernate.connection.driver_class">com.postgressql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:postgresql://127.0.0.1:5432/ali</property>
    <property name="hibernate.connection.username">ali</property>
    <property name="hibernate.connection.password">ali</property>
    <property name="hibernate.connection.pool_size">10</property>
    <property name="show_sql">true</property>
    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- Mapping files -->
    <mapping resource="contact.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    Pleas tell me that where I have done the mistake and how can I resolove the error.

    ahmadgee wrote:
    Thank u very much.
    First I tried with out the servlet. I took a simple class. But it was displaying the null pointer exception.
    then you still have the problem. do you understand the root cause?
    After then I made a servlet. how was that going to help your null pointer exception?
    Now it is displaying error hibernate.cfg.xml not found.that's part of the problem. where is the servlet reading that file and initializing the session factory? how is it finding that file?
    i don't know where you have that .cfg.xml file, or where the recommended place is where hibernate expects to see it, but i'd bet it needs to be in the CLASSPATH, which means WEB-INF/classes.
    figure out why you get that NPE first, though. the servlet is only making things worse.
    %

Maybe you are looking for

  • CS3 Master collection installation problem on Windows 7 64 bit

    Hi Guys Please can you advise I am encountering problems with the installation of CS3 Master Collection on Windows 7 64 bit, initially my hard drive crashed and performed a dump. Subsequent attempts to install CS 3 has resulted in failure to install

  • Custom screen field in the SRM portal screen for Business Partner Bidder

    I need to add a custom screen field in the SRM portal screen for Business Partner. I have added this custom field in the include structure: CI_EEW_BUT000 and activated it. I was expecting to see the enhanced field available in the SRM portal screen w

  • PhotoshopCC crashes every time I open it

    Hi, I downloaded Photoshop from creative cloud and it just crashes everytime I open it. The crash report file isnt in the photoshop programe file but I do have the below event log from my computer: Faulting application name: Photoshop.exe, version: 1

  • HD image won't mount

    Wifes' MacBook gives the " ?file" on start up. I have tried to access via 10.5 install disk and Disk Warrior. The internal HD disk never shows up to look at or repair. I have solved the "?file" before but I see no way if I can't even see the Disk?

  • How to purchase apps in indian currency

    Hi, Plz help me to purchase apps in app store with indian currency insted off US Doller thans