Friday, 21 December 2012

oracle query to export data


Oracle query to export data to a text file separated by spaces

unload sqlfile=e:\temp\tables\unload_jobs.sql 
datafile=e:\temp\tables\jobs_part2.txt 
delimiter="," quote="chr(34)" 
header=y;

Export data from mysql database


Export the data from MySql database to a text file .

SELECT * INTO OUTFILE "G:\file.txt"
      FIELDS TERMINATED BY '\t'
      LINES TERMINATED BY '\n'
FROM test.country;