This is a discussion on Writing MYSQL Query Recordset into external file. within the Database Support forums, part of the Web Development category; Hi, Here i a simple way of writing MYSQL query record set into text file and csv files. Try this, ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, Here i a simple way of writing MYSQL query record set into text file and csv files. Try this, mysql>use test; Database changed mysql> SELECT emp_id,emp_name INTO OUTFILE '/usr/local/test/employee.txt' FIELDS TERMINATED BY '|' FROM emp; Query OK, 101 rows affected (0.00 sec) mysql> SELECT emp_id,emp_name INTO OUTFILE '/usr/local/test/employee.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM emp; Query OK, 101 rows affected (0.00 sec) Now go to the specified path and check out for the text / csv files. The employee Id and the employee name has been written to the externale files.
__________________ -Murali.. |
| Sponsored Links |
| |||
| Hi, i have checked which those queries posted by u,it is executed very fine,but records not move into specified outfile. Can u clarify? Thanks, Prasath.K |
| |||
| There is no files stored in the specified path? May be u dont have permission to view the folder, check it with the folder which u have full rights.
__________________ -Murali.. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading and Writing to File using UTL_FILE in ORACLE | Murali | Database Support | 2 | 08-23-2007 11:12 PM |
| MySQL Query Performance Tips | Murali | Database Support | 10 | 08-22-2007 04:10 AM |
| How do you kill a MySQL query? | Sabari | Database Support | 2 | 07-17-2007 10:50 PM |
| How do you open a file for writing? | vadivelanvaidyanathan | Perl | 1 | 07-17-2007 03:25 AM |
| MySQL - Query Sniffer | shiva | Database Support | 4 | 03-21-2007 05:58 AM |