Jump to content

[SOLVED] LOAD DATA help


sasori

Recommended Posts

i have 3 tables

- customer

- order

- orderitem

 

inside customer table it has these columns

-cust_id

-fname

-lname

-street

-city

-state

-zip

-phone

-fax

-email

 

then i created a customer.txt file and has contents like

 

,freddy,kruger,elm street,angels,CA,20204,000-000-000,,fkruger@test.com,,,

,albert,einstein,geek street,carlson,MA,23251,000-000-000,,aeinstein@test.com,,,

 

i placed this customer .txt file in my c:\wamp\www\webapp\    directory

 

then i tried the command in my mysql console

LOAD DATA INFILE "c\wamp\www\webapp\customer.txt" INTO TABLE "customer";

but it doesn't work at all, what should i to ?  ???

i even tried to replace the double quotation mark with back ticks

or replace the backslash into forward slash..and still it won't work.

 

Link to comment
Share on other sites

LOAD DATA LOCAL INFILE "c:\wamp\www\webapp\customer.txt" INTO TABLE "customer";

 

i found another way and it worked just fine :)

LOAD DATA INFILE 'c:/wamp/www/webapp/customer.txt' INTO TABLE customer
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n';

 

thanks for the help  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.