Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Posts
    28

    Unanswered: Loading data into tables from file

    Hi,
    I have a flat file which contains about 150 fields. I have three tables each containing 50 columns. I have to insert data into each of these tables from the flat file in such a way that the first 50 fields of the records of the flat file are inserted into table1, the second 50 fields of records of the flat file are inserted into table 2 and the third 50 fields of the records of the flat file are inserted into table3. Is it possible to do so? If yes, how can I do this?

    Thanks in advance
    P.C. Vaidyanathan

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    You could load the file into a temporary table using sqlloader and then use a plsql procedure (or even a sqlplus script) to copy from the temporary table to the 3 tables.

    Alternatively you could use a java program using jdbc to load the file or even excel using vba (and odbc) if you really want to.

    Basically go for the solution you are most familiar with.

    Alan

  3. #3
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    or you can tell sqlldr to skip the last 100 fields, then run again but skipping the first 50 and last fifty, and the last pass skiping the first 100.

Posting Permissions

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