Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Posts
    31

    Unanswered: Load Data Inforl question

    Below is the code I'm trying to load my data file with. I am getting a syntax error though. I do not understand why I am getting this error, can any one plesae provide some input? The syntax error is due to the:

    FIELDS (TERMINATED BY ',')

    according to the error messege I am getting.

    Thank you,
    saiello

    LOAD DATA INFILE 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\import\\import.txt'
    INTO TABLE win_event
    (date_occured, time_occured, event_id, user_name, computer_name, event_data)
    FIELDS (TERMINATED BY ',')

  2. #2
    Join Date
    Mar 2007
    Posts
    2
    Remove the parentheses in "FIELDS (TERMINATED BY ',')"

    I'd also consider changing the path to you input file. I've had good success with double quotes around the whole path (where you are using single quotes) and if you use forward slashes in the path, you don't have to double them.

    Here's one that works for me:


    LOAD DATA INFILE "//Server01/r/DB_Final/InFile.txt"
    INTO TABLE AVT
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    LINES TERMINATED BY '\n'


    Good luck.

Posting Permissions

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