Bug #50612 SELECT ... INTO OUTFILE should support writing column name headers

Submitted: 26 Jan 2010 2:00 Modified: 26 Jan 2010 8:32
Reporter: Justin Swanhart Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: LOAD DATA INFILE, select into outfile

[26 Jan 2010 2:00] Justin Swanhart
Description:
It should be possible to write the column names into a text file exported with SELECT .. INTO OUTFILE.

LOAD DATA INFILE ... supports skipping such headers with the IGNORE 1 LINES clause.

I'd like something such as:

SELECT *
  FROM my_table
  INTO OUTFILE '/tmp/my_table.csv'
  WITH COLUMN HEADERS
  FIELDS TERMINATED BY ',' 
         ESCAPED BY '\\'
  LINES TERMINATED BY '\N'
  
Most tools support column headers in flat files, so it makes sense that MySQL should support this too.

How to repeat:
this is a feature request
[26 Jan 2010 8:15] Shane Bester
looks like bug #34992
[26 Jan 2010 8:32] Valeriy Kravchuk
Duplicate of Bug #34992.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.