User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 391,549 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,544 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 1660 | Replies: 2
Reply
Join Date: Oct 2006
Posts: 2
Reputation: lamsam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lamsam lamsam is offline Offline
Newbie Poster

write to outfile

  #1  
Oct 1st, 2006
MySQL version 4.0.27-standard
I want to write selected columns from a table to a file in my web site
I've written the following SQL statement, but I'm unsure about the syntax

SELECT event, location, eventTime, eventDate
FROM commingEvents
INTO OUTFILE '/home/_wmevents/public_html/wmEvents.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
LINES TERMINATED BY '\n'

any help correcting any errors would be appreciated
Last edited by lamsam : Oct 1st, 2006 at 9:50 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2006
Location: NYC
Posts: 133
Reputation: sn4rf3r is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
sn4rf3r's Avatar
sn4rf3r sn4rf3r is offline Offline
Junior Poster

Re: write to outfile

  #2  
Oct 2nd, 2006
Originally Posted by lamsam View Post
MySQL version 4.0.27-standard
I want to write selected columns from a table to a file in my web site
I've written the following SQL statement, but I'm unsure about the syntax

SELECT event, location, eventTime, eventDate
FROM commingEvents
INTO OUTFILE '/home/_wmevents/public_html/wmEvents.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
LINES TERMINATED BY '\n'

any help correcting any errors would be appreciated


Put the FROM after the LINES TERMINATED BY, and you should be all good
Reply With Quote  
Join Date: Oct 2006
Posts: 2
Reputation: lamsam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lamsam lamsam is offline Offline
Newbie Poster

Re: write to outfile

  #3  
Oct 2nd, 2006
Thank You
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 9:11 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC