DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: import tab delimited file

  1. #1
    Join Date
    Mar 2000
    Location
    woodbridge,nj,USA
    Posts
    14
    DBA's

    I have the following problem:

    I need to import a multi-record type tab delimited file
    into a set of Oracle tables based on each record type.

    If anyone has done something similar or has any idea how
    do import this type of file I will appreciate the help.

    The tab delimited file looks like :

    101-1joesmith
    101-2New Jersey
    102-1PaulJones
    102-2New York

    101 is the employee number -1 and -2 are the record type indicators.

    Record type 1 records are loaded into table

    emp_names
    (emp_num varchar(10),
    fname varchar(20),
    lname varchar(20))

    Record type 2 records are loaded into table

    emp_state
    (emp_num varchar(10),
    state varchar(20),
    )


    Thanks
    Umesh


  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092

  3. #3
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Talking columns seperated by ...

    'X09'
    (or is it X'09'? I forget)
    that works for me when I have tab delimited


    If you cannot get the tab-delimited to load, sometimes I open the file (in word or textpad or whatever) and "replace" all the tabs with tildes (~) or something. That is easy to do as well.

    - Magnus

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092

    Re: columns seperated by ...

    Originally posted by jgmagnus
    X'09'
    is correct
    Jeff Hunter

  5. #5
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Talking *phew*!


    thanks for the confirmation.
    good thing I caught my own mistake!

    - Magnus

  6. #6
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092

    Re: *phew*!

    Originally posted by jgmagnus


    good thing I caught my own mistake!
    If not, you know jmodic would be all over it like a hobo on a ham sandwich.
    Jeff Hunter

  7. #7
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  8. #8
    Join Date
    Mar 2000
    Location
    woodbridge,nj,USA
    Posts
    14

    solution

    Thanks DBA's

    SQLLDR worked fine using the following syntax :
    LOAD DATA
    INFILE 'orderh.txt'
    REPLACE
    INTO TABLE order_rectype1
    WHEN rec_type = '1'
    (field1 terminated by x'09',
    :
    :

    INTO TABLE order_rectype2
    WHEN rec_type = '2'
    (field1 terminated by x'09',
    :
    :



    etc

    Thanks


Posting Permissions

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


Click Here to Expand Forum to Full Width