Is it possible to import data into an existing table?

Hi.. everyone.
Is it possible to import data into an existing table
by using import utility?
The exported table and the existing table have the same name
and table schema.
I want to append "new data(exported from oracle8.0.5)" to
"an existing partitioned-table" by using "oracle 9i import utility".
Thanks in advance.
Have a nice day.
Ho.

SQL> select index_name
2 from user_indexes
3 where table_name = 'IMPORTPK';
INDEX_NAME
SYS_C007610
SQL> create view importpk_view as select * from importpk;
View created.
SQL> disconn
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options
SQL> exit
C:\>exp userid=oracle/oracle tables=importpk
Export: Release 10.1.0.2.0 - Production on Tue Sep 5 08:30:50 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table IMPORTPK 10 rows exported
Export terminated successfully without warnings.
C:\>imp userid=oracle/oracle tables=importpk ignore=y
Import: Release 10.1.0.2.0 - Production on Tue Sep 5 08:31:12 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.01.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. importing ORACLE's objects into ORACLE
. . importing table "IMPORTPK"
IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (ORACLE.SYS_C007610) violated
Column 1 1
Import terminated successfully with warnings.
C:\>sqlplus/nolog
SQL*Plus: Release 10.1.0.2.0 - Production on Tue Sep 5 08:33:20 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
1.No
Note : if table content primary key and index.
SQL> conn oracle/oracle
Connected.
SQL> create table withoutcons ( no number);
Table created.
SQL> insert into withoutcons select * from importpk;
10 rows created.
SQL> create view withoutcons_view as select * from withoutcons;
View created.
SQL> disconn
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options
SQL> exit
C:\>exp userid=oracle/oracle tables=withoutcons
Export: Release 10.1.0.2.0 - Production on Tue Sep 5 08:36:05 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table WITHOUTCONS 10 rows exported
Export terminated successfully without warnings.
C:\>imp userid=oracle/oracle tables=withoutcons ignore=y
Import: Release 10.1.0.2.0 - Production on Tue Sep 5 08:37:17 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.01.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. importing ORACLE's objects into ORACLE
. . importing table "WITHOUTCONS" 10 rows imported
Import terminated successfully without warnings.
2. Yes
If table content no unique constraints
Message was edited by:
user526020

Similar Messages

  • Importing data into an existing table from excel problem

    Hopefully I am posting this in the right place..
    I am having trouble importing data from Excel into an oracle table using the 'import data' wizard in SQL developer.
    The problem is that the I want to import data into a table which all ready has data and I want the new data to be imported into the first row of the table not in a new row at the end of the table.
    This is probably best shown by example:
    create table todelete (
         site_no varchar2(2),
         data1 number,
         qa number);
    insert into todelete values ('w1',1,null);
    insert into todelete values ('w1',2, null);
    insert into todelete values ('w1',3,null);
    Now I want to import the following data from excel into the QA column starting at w1:
    SITE_NO
    QA
    w1
    4
    w2
    4
    w3
    4
    However, when I import the QA column it goes into a new row:
    SITE_NO
    DATA1
    QA
    w1
    1
    NULL
    w2
    2
    NULL
    w3
    3
    NULL
    NULL
    NULL
    4
    NULL
    NULL
    4
    NULL
    NULL
    4

    The problem is that the I want to import data into a table which all ready has data and I want the new data to be imported into the first row of the table not in a new row at the end of the table.
    No - the PROBLEM is that a table does NOT have a 'first' row or a 'row at the end of the table'.
    Rows in a table are like balls in a basket; there is NO 'first' ball.
    As already suggested please mark this thread ANSWERED and repost it in the sql developer forum where it belongs.

  • Is it possible to import data into a Reader Extended PDF created in Livecycle?

    Hi there,
    I make a lot of Reader Extended forms for my company. When I issue form updates, sometimes staff have to re-copy or re-type records into forms with repeating subforms.  I'd like to be able to jumpstart their process by importing from an old, filled-out form, into my new updated form.
    I've found I can do this by making an XML data file of the data from the old form, but I can't import into an Extended from using Adobe Reader. Most of our staff don't have Acrobat, so they aren't able to save data into non-extended forms.
    Is this clear, what I'm asking? Import XML data into Reader Extended form.
    Thanks for any help you can give,
    Laura

    Hi,
    It's indeed possible to import data in a reader enabled form with Reader.
    Here's a sample:
    LiveCycle Blog: XML per Skript in Adobe Reader importieren//Import XML via Script into Adobe Reader

  • Is it possible to import data into Captivate 5?

    Is it possible to import data back into a Captivate 5 lesson, that was  stored to a server or database from earlier in the Captivate 5 lesson?   We would like to redisplay data from one screen to another.  Some if it  is quiz results, some just responses to questions we ask the user and we  sould like to show it again for discussion on the next screen or in an  entirely separate lesson.  Thanks.

    You can easily store data in user variables that will persist for the duration of the user's browser session for a given Captivate lesson.  But if you want to have the same data persist over multiple browser sessions you need to write this data to cookies on the users PC or else write it to a database somewhere online and pull it back from there in later modules.
    The first option using variables is quite easy to do with Advanced Actions.
    The second option using an external database is much more difficult and would require ActionScript programming skills as well as database programming skills for the specific database technology you use and the scripting technologies used to write and retrieve data from it.  If you don't have these skillsets yourself, you're going to need to put together a project with a budget to hire the designers and developers required to pull it off.

  • How to import data into a Z table from excel file?

    hi,
    i have a custom created Z table into which i want to import some data from an excel file. which function can i use to do so because SE16 allows me to insert data only one by one via a data entry screen. this is time consuming. i want to import data from excel file so that its faster.

    HI,
    this program uploads data from excel and modifies ztable,(inserts records into ztable), check this and modify according to ur requirement)
    This program uploads material number from excel sheet and does
    ******modifications to material number if required by the user
    ******and updates the table zmatnr with new material against the old material number
    REPORT  zmat_no message-id zebg.
    TYPE-POOLS  truxs.
    TABLES:zmatnr.
    DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA row LIKE alsmex_tabline-row.
    data : g_matnr like mara-matnr.
    data : count type i.
    data : itab_count type i.
    data : gi_final like zmatnr occurs 0 with header line.
    *data : begin of gi_final occurs 0,
          mat_old like mara-matnr,
          mat_new like mara-matnr,
          end of gi_final.
    ***********************Selection Screen*************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
    select-options : records for count.
    SELECTION-SCREEN END OF BLOCK b1.
    *********************At Selection Screen*************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
      PERFORM search.
    START-OF-SELECTION.
    perform process.
    form process.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = pfname
          i_begin_col             = 1
          i_begin_row             = 2
          i_end_col               = 12
          i_end_row               = 65000
        TABLES
          intern                  = itab
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      describe table itab lines itab_count.
       row = 1.
      loop at itab.
        if itab-row <> row.
          append gi_final.
          clear gi_final.
        endif.
        case itab-col.
          when '1'.
          CLEAR G_MATNR.
          gi_final-OLD_MATNR = itab-value.
          CONCATENATE 'NEW' gi_final-old_matnr INTO itab-value.
            gi_final-new_MATNR = itab-value.
          endcase.
        row = itab-row.
      append gi_final.
      clear gi_final.
      endloop.
      CALL FUNCTION 'PROGRESS_INDICATOR'
      EXPORTING
        I_TEXT  = 'File Has Been Successfully Uploaded from Workstation ' .
      if not gi_final[] is initial.
        if not records-low is initial .
          if not records-high is initial.
            records-high = records-high + 1.
            DESCRIBE TABLE gi_final LINES count.
            IF records-high < count.
              DELETE gi_final FROM records-high TO count.
            ENDIF.
            IF records-low <> 1.
              IF records-low <> 0.
                DELETE gi_final FROM 1 TO records-low.
              ENDIF.
            ENDIF.
          endif.
        endif.
      endif.
      IF NOT GI_FINAL[] IS INITIAL.
        CALL FUNCTION 'PROGRESS_INDICATOR'
         EXPORTING
           I_TEXT  = 'Processing zmatnr table'
           I_OUTPUT_IMMEDIATELY = 'X'.
          if itab_count <> count.
             message i000 with 'records are not matching'.
             exit.
          else.
             modify zmatnr from table gi_final.
             message i000 with 'data base table modified successfully'.
          endif.
      endif.
    endform.
    *&      Form  search
          text
    -->  p1        text
    <--  p2        text
    FORM search .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = pfname.
    ENDFORM.                    " search
    regards
    siva

  • How to import data in to existing data grid of a websheet app

    Hi,
    I have a datagrid in a websheet application, where i need to import data for every specific interval of time(interval is not regular).
    Is it possible to import data in to existing data grid using an excel or a csv file?
    if possible, could any one please guide me?
    thanks
    srinivas

    Hello,
    Have you had a look at the Home -> Utilities -> Data Load/Unload section in APEX? That will let you load data from a TEXT, CSV and/or XML format file.
    Alternatively you can use SQLDeveloper (locally) to generate a script containing the INSERT statements to regenerate your data, then run that script in SQL Workshop.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Can I use Dreamweaver to import data into specific fields on a website?

    We need to build a website that will allow us to import data from an existing database, into specific fields on website (desktop and mobile).  Is it possible to do that in Dreamweaver?

    Ben answered your question. You asked if one CAN use DW to call data. Just understand that it isn't necessary to use DW for this, and there are good reasons not to.
    Using a plug-in or data behaviors allows you to get up and running quickly, but they are like training wheels on a bicycle. Eventually they cripple your capabilities and you have to go back to the beginning to learn how to do things right, which means making the connections and writing the code yourself. Why not just do it the right way from the start?
    If you script the database connections and queries yourself, you can still work within DW.
    You did not specify which kind of server, database or scripting language you plan to use. The typical configuration is MySQL database and PHP scripting on Linux.

  • SSIS 2012 is intermittently failing with below "Invalid date format" while importing data from a source table into a Destination table with same exact schema.

    We migrated Packages from SSIS 2008 to 2012. The Package is working fine in all the environments except in one of our environment.
    SSIS 2012 is intermittently failing with below error while importing data from a source table into a Destination table with same exact schema.
    Error: 2014-01-28 15:52:05.19
       Code: 0x80004005
       Source: xxxxxxxx SSIS.Pipeline
       Description: Unspecified error
    End Error
    Error: 2014-01-28 15:52:05.19
       Code: 0xC0202009
       Source: Process xxxxxx Load TableName [48]
       Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Invalid date format".
    End Error
    Error: 2014-01-28 15:52:05.19
       Code: 0xC020901C
       Source: Process xxxxxxxx Load TableName [48]
       Description: There was an error with Load TableName.Inputs[OLE DB Destination Input].Columns[Updated] on Load TableName.Inputs[OLE DB Destination Input]. The column status returned was: "Conversion failed because the data value overflowed
    the specified type.".
    End Error
    But when we reorder the column in "Updated" in Destination table, the package is importing data successfully.
    This looks like bug to me, Any suggestion?

    Hi Mohideen,
    Based on my research, the issue might be related to one of the following factors:
    Memory pressure. Check there is a memory challenge when the issue occurs. In addition, if the package runs in 32-bit runtime on the specific server, use the 64-bit runtime instead.
    A known issue with SQL Native Client. As a workaround, use .NET data provider instead of SNAC.
    Hope this helps.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Writing a stored procedure to import SQL Server table data into a Oracle table

    Hello,
    As a new DBA I have been tasked with writing a stored procedure to import SQL Server table data into an Oracle table. I have been given many suggestions on how to do it from SQL Server but I I just need to write a stored procedure to run it from the Oracle side. Suggestions/guidance on where to start would be greatly appreciated! Thank you!
    I started to write it based on what I have but I know this is not correct :/
    # Here is the select statement for the data source in SQL Server...
    SELECT COMPANY
    ,CUSTOMER
    ,TRANS_TYPE
    ,INVOICE
    ,TRANS_DATE
    ,STATUS
    ,TRAN_AMT
    ,CREDIT_AMT
    ,APPLD_AMT
    ,ADJ_AMT
    ,TRANS_USER1
    ,PROCESS_LEVEL
    ,DESCRIPTION
    ,DUE_DATE
    ,OUR_DATE
    ,OUR_TIME
    ,PROCESS_FLAG
    ,ERROR_DESCRIPTION
      FROM data_source_table_name
    #It loads data into the table in Oracle....   
    Insert into oracle_destination_table_name (
    COMPANY,
    CUSTOMER,
    TRANS_TYPE,
    INVOICE,
    TRANS_DATE,
    STATUS,
    TRANS_AMT,
    CREDIT_AMT,
    APPLD_AMT,
    ADJ_AMT,
    TRANS_USER1,
    PROCESS_LEVEL,
    DESCRIPTION,
    DUE_DATE,
    OUR_DATE,
    OUR_TIME,
    PROCESS_FLAG,
    ERROR_DESCRIPTION)
    END;

    CREATE TABLE statements would have been better as MS-SQL and Oracle don't have the same data types.
    OUR_DATE, OUR_TIME will (most likely) be ONE column in Oracle.
    DATABASE LINK
    Personally, I'd just load the data over a database link:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_table@mssql_db_link
    As far as creating the database link from Oracle to MS-SQL ... that is for somebody else to answer.
    (most likely you'll need to use an ODBC driver)
    EXTERNAL TABLE
    If the data from MS-SQL is in a CSV file, just use and external table.
    same concept:
    insert into oracle_destination_table_name ( <column list> )
    select ... <transform data here>
    from data_source_external_table
    MK

  • Is it possible to insert data into a MySQL database with Java?

    Hello everyone!
    I would like to know, if it's possible to insert data into a MySQL database, with a JFrame inside a servlet?
    When the JFrame is first created it calls this method:
         * Connects the servlet with the MySQL database.
        private void connect(){
            try{
                Class.forName("com.mysql.jdbc.Driver");
                connection = DriverManager.getConnection(
                        "jdbc:mysql://localhost:3306/data", "root", "omfg123");
            }catch(ClassNotFoundException cnfe){
                cnfe.printStackTrace();
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }Then, when you click the "Add" button, it executes this code:
                add.addActionListener(new ActionListener(){
                    @Override
                    public void actionPerformed(ActionEvent ae){
                        String employee = employeeName.getText();
                        String[] args = employee.split(" ");
                        firstName = args[0];
                        lastName = args[1];
                        execute();
                });And this is my "execute()" method:
         * Connects the servlet with the MySQL database.
         * - And executes the SQL queries.
        private void execute(){
            try{
                PreparedStatement statement = connection.prepareStatement("insert" +
                        " into employees values(" + firstName + ", " + lastName
                        + ")");
                ResultSet result = statement.executeQuery();
                String fullName = firstName + " " + lastName;
                printer.write("Employee " + fullName + " added.</br>");
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }But when I click the "Add" button, nothing happens.

    This is what I use to insert into mysql. It works on windows.
    try {
                Class.forName("com.mysql.jdbc.Driver");
                String connectionUrl = "jdbc:mysql://" + loadip + "/custsig?" +
                        "user=root&password=";
                Connection con = DriverManager.getConnection(connectionUrl);
                newproc = jTextField1.getText();
                newsoft = jTextField2.getText();
                newdeb = jTextField3.getText();
                newcust = jTextField4.getText();
                if (newcust.equals("")) {
                    errorsig12 = 1;
                    jLabel1.setForeground(new java.awt.Color(255, 0, 0));
                } else if (newsoft.equals("")) {
                    errorsig12 = 1;
                    jLabel2.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newproc.equals("")) {
                    errorsig12 = 1;
                    jLabel3.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newdeb.equals("")) {
                    errorsig12 = 1;
                    jLabel4.setForeground(new java.awt.Color(0, 0, 0));
                if (errorsig12 == 0) {
                    PreparedStatement ps = con.prepareStatement("insert into customer set cust_name = ?,  software = ?, processor = ?, debit = ?");
                    ps.setString(4, newdeb);
                    ps.setString(3, newproc);
                    ps.setString(2, newsoft);
                    ps.setString(1, newcust);
                    int rs = ps.executeUpdate();
            } catch (SQLException eg) {
                System.out.println("SQL Exception: " + eg.toString());
            } catch (ClassNotFoundException cE) {
                System.out.println("Class Not Found Exception: " + cE.toString());
            }

  • Importing Data into Sql Server 2012 from Excel Data

    Hi,
    I got errors like this when i am doing import data into sql server from excel Data. Can you please help us?
    - Executing (Error)
    Messages
    Error 0xc020901c: Data Flow Task 1: There was an error with Source - demotable$.Outputs[Excel Source Output].Columns[Comment] on Source - demotable$.Outputs[Excel Source Output]. The column status returned was: "Text was truncated or one
    or more characters had no match in the target code page.".
     (SQL Server Import and Export Wizard)
    Error 0xc020902a: Data Flow Task 1: The "Source - demotable$.Outputs[Excel Source Output].Columns[Comment]" failed because truncation occurred, and the truncation row disposition on "Source - demotable$.Outputs[Excel Source Output].Columns[Comment]"
    specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
     (SQL Server Import and Export Wizard)
    Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - demotable$ returned error code 0xC020902A.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
     (SQL Server Import and Export Wizard)

    Are you attempting to import into a newly made table or into an existing table? It looks like it's trying to insert data where it cannot be inserted (invalid column or lack of data size in your column).
    Try the following:
    1). In your excel sheet, highlight the whole sheet and make sure the cells are in 'text' form and try re-importing
    2). save the document as ms dos TEXT and import as a text document.
    3). double check your columns are correct for the data, for example if you have a column that has a string of 100 characters and your column is 'NvarChar(90)' - that might cause the error? Or just correct data type in your column
    3). If that doesn't work and you're inserting into a new table, try importing it as string first and writing a query to insert columns that should be float/integer or whatever. You may want to convert float texts to a 'bigint' first rather than string
    > float as that can cause problems if I remember correctly.

  • Import data into oracle from a text file?

    hi guys,
    How can we import data into oracle9i release 1 from a text file with comma seperated or tab seperated delimeters?
    please help,
    Imran

    table is already created, just have to populate data into table through a dat or text file. As suggested, you would either:
    1). use SQL*Loader to load the data into this table.
    2). create external table on that data file and then do:
    INSERT INTO your_real_table
    SELECT * FROM that_external_table ;

  • What is the best protocol to import data into sqlserver using an SSIS Package?

    Im trying to import data into SQL Server from EXCEL with an SSIS package. In my data flow I am using "Excel Source" object and an "OLE DB Command" object.  Im getting the following error message, "...Excel Connection Manager"
    is an incorrect type....."  May someone explain why I get this and point me in the right direction in choosing the proper source for my package so I can complete my task.  Thanks.

    Hi jsorrisone,
    The data type mismatch issue is a common issue when using Excel Source in SSIS. The Excel driver recognizes only a limited set of data types. The following section of the document
    Excel Source should point you in the right direction:
    The Excel driver recognizes only a limited set of data types. For example, all numeric columns are interpreted as doubles (DT_R8), and all string columns (other than memo columns) are interpreted as 255-character Unicode strings (DT_WSTR). Integration
    Services maps the Excel data types as follows:
    Numeric – double-precision float (DT_R8)
    Currency – currency (DT_CY)
    Boolean – Boolean (DT_BOOL)
    Date/time – datetime (DT_DATE)
    String – Unicode string, length 255 (DT_WSTR)
    Memo – Unicode text stream (DT_NTEXT)
    Integration Services does not implicitly convert data types. As a result, you may need to use Derived Column or Data Conversion transformations to convert Excel data explicitly before loading it into a non-Excel destination, or to convert non-Excel data
    before loading it into an Excel destination. In this case, it may be useful to create the initial package by using the Import and Export Wizard, which configures the necessary conversions for you. Some examples of the conversions that may be required include
    the following:
    Conversion between Unicode Excel string columns and non-Unicode string columns with specific codepages
    Conversion between 255-character Excel string columns and string columns of different lengths
    Conversion between double-precision Excel numeric columns and numeric columns of other types
    If you need further help, post the complete error message as well as the data nature in your Excel source file for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • Import Excel File Data into oracle database table.

    HI,
    i want to insert data into a specific table from a excel file. please help me..
    for example
    emp.xls file's data need to be import in emp database table.
    thanks in advance...

    Hi,
    to all knowledgable person, this would be gald for u all that i have solved the problem.
    through this procedure..
    PROCEDURE IMPORT_FROM_EXCEL_PROC (as_FileName VARCHAR2, exe_name varchar2) IS
              appid PLS_INTEGER;
              convid PLS_INTEGER;
              docid PLS_INTEGER;
              conv_established BOOLEAN := FALSE;
              buffer VARCHAR2(100);      
              Emp_code VARCHAR2(100);
              Emp_name VARCHAR2(100);
              Emp_desig VARCHAR2(100);
              Emp_Salary VARCHAR2(100);
              ls_error VARCHAR2(1000);
              li_row integer;
              li_col integer;
              li_error_count integer;
              li_load_count integer;
    BEGIN
         --Start Excel
         --This line assumes that Excel is in the specified directory
              --     APPID := DDE.APP_BEGIN('D:\OFFICE11\EXCEL.EXE',DDE.APP_MODE_MINIMIZED);
              APPID := DDE.APP_BEGIN(exe_name,DDE.APP_MODE_MINIMIZED);
         --Establish a conversation with Excel
         --The following loop will not end until a conversation with Excel
         --has been established. Therefore, it can result in a endless loop,
         --so use with caution.
              WHILE NOT conv_established LOOP
              BEGIN
              convid := DDE.INITIATE('excel', 'system');
              conv_established := TRUE;
              EXCEPTION
              WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
              conv_established := FALSE;
              END;
              END LOOP;
         --Open Excel document
         --This assumes that you have an Excel spreadsheet named ddetest.xls in the root of c:
              DDE.EXECUTE(convid, '[Open("'||as_FileName||'")]', 10000);     
         --Initiate conversation with Excel document
              docid := DDE.INITIATE('excel',as_FileName);
         --Begin transfer from Excel to Forms
                   li_load_count := 0;
                   li_error_count := 0;
                   li_col := 1;
                   li_row := 2;
                   GO_BLOCK('IMPORT_XLS');          
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);          
                   WHILE length(buffer) > 2 LOOP           
                   WHILE li_col < 5 LOOP
                        buffer := substr(buffer, 1, instr(buffer, chr(10)) - 2);               
                   IF li_col = 1 THEN --Emp_code
                        Emp_code := buffer;     
                   ELSIF li_col = 2 THEN --Emp_name     
                        Emp_name := buffer;     
                   ELSIF li_col = 3 THEN --Emp_desig      
                        Emp_desig := buffer;     
                   ELSE --Emp_salary
                        Emp_salary := buffer;
                   END IF;
                   IF nvl(ls_error,'N') = 'N' THEN
                   li_col := li_col + 1;
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);
                   ELSE
                   li_col := 5;
                   END IF;               
                   END LOOP;
                   IF nvl(ls_error, 'N') = 'N' THEN
                   li_load_count := li_load_count + 1;
                   IF li_load_count = 1 THEN
                   FIRST_RECORD;
                   ELSE
                   NEXT_RECORD;
                   END IF;
                   :IMPORT_XLS.Emp_code := Emp_code;               
                   :IMPORT_XLS.Emp_name := Emp_name;          
                   :IMPORT_XLS.Emp_desig := Emp_desig;
                   :IMPORT_XLS.Emp_salary := Emp_salary;
                   ELSE
                   li_error_count := li_error_count + 1;
                   DDE.POKE(docid, 'R' || TO_CHAR(li_row) || 'C5', ls_error, DDE.CF_TEXT, 10000);
                   END IF;
                   ls_error := '';
                   Emp_code := '';
                   Emp_name := '';
                   Emp_desig := '';
                   Emp_salary := '';
                   li_col := 1;
                   li_row := li_row + 1;
                   DDE.REQUEST (docid, 'R' || TO_CHAR(li_row) || 'C' || TO_CHAR(li_col), buffer, DDE.CF_TEXT, 1000);                
                   END LOOP;               
                   IF li_error_count > 0 THEN
                        DDE.EXECUTE(convid, '[[save]]', 10000);
                        Message(TO_CHAR(li_load_count) || ' Record(s) Loaded. ' ||
                        TO_CHAR(li_error_count) || ' Invalid Record(s). See error in excel file.');
                        ELSE
                        Message(TO_CHAR(li_load_count) || ' Record(s) Successfully Loaded.');
                   END IF;                
                   --End transfer to Excel
                   DDE.TERMINATE(docid);
                   DDE.TERMINATE(convid);
                   DDE.APP_END(appid);                          
                   --Handle exceptions
                   EXCEPTION
                   WHEN DDE.DDE_APP_FAILURE THEN
                   MESSAGE('WINDOWS APPLICATION CANNOT START.');
                   WHEN DDE.DDE_PARAM_ERR THEN
                   MESSAGE('A NULL VALUE WAS PASSED TO DDE');
                   WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
                   MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
                   WHEN DDE.DMLERR_NOTPROCESSED THEN
                   MESSAGE('A TRANSACTION FAILED');
    END;

  • Is it possible to import music into iPad without using iTunes?

    Do any of of you know whether or not it is possible to import music into iPad, like when you can import pictures, without the use of iTunes ( I don't have a computer)? I have music on my phone and on USB flash drives. Thnx

    If you are in America then you can download your past iTunes music purchases via the store (http://support.apple.com/kb/HT2519). But no, you can't import from flash drives (the camera connection kit can only import photos and videos) or from an iPhone.

Maybe you are looking for

  • OUT of Blue Message

    Went to print document and got Incorrect black ink cartridge installed message. Using HP 56 Black Ink Cartridge had printer over 5 years and first time ever see this. I have taken cart out and replace, plugged and unplugged printer - any ideas? Do i

  • How to handle userIntraction error in PC

    While running Indesign CS4 script I am getting userIntraction error in PC, how to rectify that error

  • Bad sectors Qosmio F60 HDD

    Qosmio F60 PQF65A-00Y002 Windows 7 Home Premium  SP1 After installing Windows SP1 I had a number of problems. I can't see how they were directly related but maybe some indirect effect. One of them is that suddenly I have a few very agreessively bad

  • Lightroom mobile sync

    I just downloaded the trial version of lightroom and lightroom mobile app, and I am unable to sync.  Is the sync feature only allowed IF you pay the subscription?  Does not list anywhere that trial versions do not sync.  Please help!?

  • Help with Mail Package

    Hi all, I have a interface PROXY - MAIL. I need to generate the attachment name dynamically, send an attachment and fill the body of email. I'm using Mail Package, according to note 748024. But I do not know how to fill the body of email and send att