2 Replies Latest reply on Oct 15, 2002 9:26 AM by 13666

    Taking Excel data and inserting it into Oracle DB

    271367
      I have an Excel spreadsheet with loads of data I need to put into an Oracle DB. Can anyone help me out? This is extremely urgent. Thanks, Jeremy
        • 1. re:Taking Excel data and inserting it into Oracle DB
          82532
          I don't think any of the examples show going from Excel into Oracle, only the other way 'round. You would need to write some VBA code to pull the data from the spreadsheet cells and do the insert. I'll see if I have any examples of that.
          • 2. re:Taking Excel data and inserting it into Oracle DB
            13666
            This is my sample appication source :

            ================================
            OraDatabase.ExecuteSQL ("truncate table krlee")
            OraDatabase.AutoCommit = False
            OraDatabase.ExecuteSQL ("alter session set cursor_sharing = 'FORCE'")
            Worksheets("KRP_TIME_LIST").Activate
            For i = InputBox("Beginning row please...") To Worksheets("KRP_TIME_LIST").Cells.SpecialCells(xlLastCell).Row Step 1
            krlee = "insert into krlee values ('" + _
            CStr(Cells(i, 1).VALUE) + "','" + _
            CStr(Cells(i, 2).VALUE) + "','" + _
            CStr(Cells(i, 3).VALUE) + "','" + _
            CStr(Cells(i, 4).VALUE) + "','" + _
            CStr(Cells(i, 5).VALUE) + "','" + _
            CStr(Cells(i, 6).VALUE) + "','" + _
            CStr(Cells(i, 7).VALUE) + "','" + _
            CStr(Cells(i, 8).VALUE) + "','" + _
            CStr(Cells(i, 9).VALUE) + "','" + _
            CStr(Cells(i, 10).VALUE) + "','" + _
            CStr(Cells(i, 11).VALUE) + "')"
            OraDatabase.ExecuteSQL (krlee)
            Next i
            OraDatabase.ExecuteSQL ("commit")
            OraDatabase.ExecuteSQL ("alter session set cursor_sharing = 'EXACT'")
            MsgBox ("Loading done successfully.")
            ===================================
            like above.