If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Load Data Inforl question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-25-07, 18:02
saiello saiello is offline
Registered User
 
Join Date: Aug 2002
Posts: 31
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 ',')
Reply With Quote
  #2 (permalink)  
Old 03-25-07, 18:54
gwoolverton gwoolverton is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On