MySQL Forums
Forum List  »  Oracle

Re: How to export data from MySql query browser to a flat file
Posted by: Roland Bouman
Date: March 24, 2006 07:03AM

You want to export data from oracle to mysql by running an oracle script?

just write the select that gets your data, and run it in sql*plus. Use the spool functionionlity to capture the outpu in a file:

set trimspool on
set heading off
set pagesize 0
spool 'filenameandpath.txt'

select ...
from ..
/

spool off

now you have a txt file with data.
in mysql, import this using either

LOAD DATA INFILE

(http://dev.mysql.com/doc/refman/5.0/en/load-data.html)

or the mysqimport utility (http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html)

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

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.