List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 9 2001 3:01pm
Subject:Re: select into outfile problem
View as plain text  
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
select into outfile problemNiklas Rudemo9 Apr
  • Re: select into outfile problemPaul DuBois9 Apr