List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:April 10 2001 2:11pm
Subject:Re: FW: select into outfile problem
View as plain text  
Have your script delete it first.

Niklas Rudemo wrote:
> 
> Maybe I didn't state the problem clearly enough.
> I want write to a file that does exist,
> i.e., overwrite the existing file.
> 
> -----Original Message-----
> From: Paul DuBois [mailto:paul@stripped]
> Sent: den 9 april 2001 17:01
> To: Niklas Rudemo
> Cc: mysql@stripped
> Subject: Re: select into outfile problem
> 
> On Mon, Apr 09, 2001 at 03:48:43PM +0200, Niklas Rudemo wrote:
> > I'm trying to select into outfile to a file that already exist.
> > This has been discussed before, I know, but the solution suggested
> > results in an SQL-error, as shown below. So what's the real solution?
> 
> Select your rows into a temporary table, which will allow you to run
> several queries to obtain the rows.  Then use SELECT ... INTO OUTFILE
> with the temporary table (into a file that doesn't exist).
> 
> >
> > Niklas Rudemo
> > Virtutech
> >
> > mysql> select * into outfile 'person.txt' from person;
> > Query OK, 0 rows affected (0.00 sec)
> >
> > mysql> select * into outfile 'person.txt' from person;
> > ERROR 1086: File 'person.txt' already exists
> >
> > mysql> select * into outfile 'person.txt' REPLACE from person;
> > ERROR 1064: You have an error in your SQL syntax near 'REPLACE from
> person'
> > at l
> > ine 1
> 
>
Thread
FW: select into outfile problemNiklas Rudemo10 Apr
  • Re: FW: select into outfile problemGerald Clark10 Apr