Re: linux/unix script to dump csv files for each table in db
Date: Wed, 1 Dec 2010 17:38:24 +0000 (UTC)
On Wed, 01 Dec 2010 06:52:26 -0800, Mark D Powell wrote:
> On Nov 30, 7:45 am, syd_p <sydneypue..._at_yahoo.com> wrote:
>> I am using a very simple script to dump out some csv files from all the
>> tables in a mysql db.
>> Well actually they are psv files cos they are separted by a pipe
>> But anyway I want to do the same thing with oracle 10G. Any ideas on
>> how to do this?
>> Please help if you can!
>> for table in $(mysql -u$user -p$pass $db -Be "SHOW tables" | sed 1d);
>> do \
>> echo "exporting $table.."
>> mysql $db -u$user -p$pass -e "SELECT * FROM $table" | sed
>> 's/\t/|/g'> $db.$table.psv
> > How do I export a database table to a flat file ? > > http://www.jlcomp.demon.co.uk/faq/flatfile.html > > HTH -- Mark D Powell --
There are, of course, tools like this one:
I have the new revision which will be put on the website tonight. The new revision has the binary flag turned on, to do the trick with the binary data and allows the choice of separators. The default separator is changed from the comma to tab.Received on Wed Dec 01 2010 - 11:38:24 CST