Results 1 to 3 of 3

Thread: input from file

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    Unanswered: input from file

    Hi everyone!
    My problem deals with populating my table using data in a .dat file. I've only just begun using SQL. Anyway, this is my table definition:

    CREATE TABLE Customer (
    Cust_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    Cust_Key VARCHAR(20) NULL,
    Cust_Name VARCHAR(20) NULL,
    Cust_Address VARCHAR(50) NULL,
    PRIMARY KEY(Cust_ID)
    );

    What I need to do is select records from a .dat file and insert them into this. The problem is that the file has more records than I need to enter. Here's one tuple from the file:

    dces-1;SMITH;Rockville Street 3, Flat 4-A DC 49231 Wonderland;February;56470;55999;471;1890;143;2033; 2233;March 12, 1999;

    What I need to do is insert the first three fields into the 2nd, 3rd and 4th field respectively. I've searched extensively online on how to implement this and found bulkinsert and load data infile, but can't implement it. Any help would be appreciated.
    Thank you.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    SQLLDR
    or
    EXTERNAL TABLE
    either of the 2 above or if you are a real glutton for punishment utilize UTL_FILE
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    AUTO_INCREMENT is not a valid command in oracle. Use sequences and triggers.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Tags for this Thread

Posting Permissions

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