Re: select ... into local outfile ... ???

2011-09-03 Thread Dennis
Thanks, Tyler,  That's very helpful. Dennis --- On Sat, 9/3/11, Tyler Poland tpol...@engineyard.com wrote: From: Tyler Poland tpol...@engineyard.com Subject: Re: select ... into local outfile ... ??? To: mysql@lists.mysql.com Date: Saturday, September 3, 2011, 3:45 AM Dennis, The following

Re: select ... into local outfile ... ???

2011-09-03 Thread Hal�sz S�ndor
2011/09/03 03:40 +0800, Dennis But it seems that there is no select ... into LOCAL file statement. Any suggestion is appreciated. Indeed: you can use only standard output. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

select ... into local outfile ... ???

2011-09-02 Thread Dennis
hi, there, the following is my sql statement: SELECT   HIGH_PRIORITY   SQL_BIG_RESULT   SQL_NO_CACHE   tb.url_sign,  m_url,    m_title,   m_weight    INTO OUTFILE   '/tmp/a.csv'  FIELDS TERMINATED BY ','  ENCLOSED BY '\'   LINES  TERMINATED BY '\n' STARTING BY '=' FROM d_local.ta, d_news.tbWHERE

Re: select ... into local outfile ... ???

2011-09-02 Thread Tyler Poland
Dennis, The following closely simulates the default INTO OUTFILE, you'll have to modify it slightly for your purposes: mysql --delimiter=comma -N select_statement.sql \ | sed 's/\/\\\/g' \ | sed 's/\t/\,\/g' \ | sed 's/$/\/g' \ | sed 's/^/\/g' \ | sed 's/\NULL\/\\N/g' \ | sed