Results 1 to 4 of 4

Thread: how to insert data using SQL from a excel sheet to orcale data base

  1. #1
    Join Date
    May 2003
    Posts
    2

    Lightbulb how to insert data using SQL from a excel sheet to orcale data base

    i am using orcale 8i and need to insert
    often data (rows in the range of 50000)
    from a Excel sheet to data base.
    Need to know how can i write an sql for this.
    Thanks

  2. #2
    Join Date
    May 2003
    Posts
    4
    I do the same kind of import in MSSQL. In your Excel spreadsheet create a name range (Insert > Name > Define ). Make sure that the first row in your spreadsheet has the field names. Next, create an ODBC excel datasource pointing to the files. Now, you can query the datasource using SQL statements as you would any other database. The name range specified in the spreadsheet will be your table with the corresponding fields. I hope this helps.

  3. #3
    Join Date
    May 2003
    Posts
    2
    thanks for your reply sscoffey.
    it was very helpful but now other problem is field size how can i restrict field size of excel file.when i am creating an odbc it takes field size as varchar2 510 where as table in which i am trying to import have field size limited to varchar2 5 only.any idea?

  4. #4
    Join Date
    May 2003
    Posts
    4
    When I import MS Excel data to an MS SQL database, I am typically importing numeric data. I am able to directly import from spreadsheet cells formatted as numeric into a numeric data type (real,decimal,etc.) without manipulating the data. Consequently, I have not had the same problem you are experiencing. However, in other imports I have often been able to use MS SQL's "cast" or "convert" functions to convert one data type to another. Not being familiar with Oracle, I am not sure if there is an eqivalent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •