[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Exporting ascii files from SQL
On Mon, Jul 19, 1999 at 06:33:13PM -0700, August Detlefsen wrote:
> ****** message to minivend-users from August Detlefsen <augustd@idiom.com> ******
>
> I'd like to build an exporter that would export our SQL DBs to an .asc file as a cron job. The if anything ever happens, it should be a simple matter to re-import the ascii file.
>
> Anyone have an idea what the best way would be? I've tried a couple of things, from a simple script that calls a page with [tag export products], up to a script that calls export_database in Data.pm. Any help would be appreciated.
I don't know if it's mysql specific but
SELECT * INTO OUTFILE foo.asc FROM bar WHERE gletch
works pretty well to make a tab separated list,
and there is syntax to load those files back in, too.
--
Anthony Ball ant@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
tel:1.207.657.5078 fax:1.207.657.5048 http://www.maine.com/