On Wed, May 09, 2001 at 09:43:54AM -0400, Bill Moran wrote:
> Thanks for the reply, unfortunately, this produces the same error as the
> command I tried. (ERROR 1064: near 'dumpfile '/data/test.doc' where
> appid=23')
> 
> I can do a "INTO OUTFILE" just fine if I use this syntax:
> SELECT resume FROM apps WHERE appid=23 INTO OUTFILE '/data/test.doc';
> 
> Using this:
> SELECT resume FROM apps INTO OUTFILE '/data/test.doc' WHERE appid=23;
> Produces an error 1064

Of course it would.
Put the 'into dumpfile' part BEFORE the 'from' clause.

And btw, which version of MySQL are you running?  The query I listed,
with 'into dumpfile' before the 'from' clause, works fine on MySQL 3.23.37.
It does NOT work on MySQL 3.22.x, because, in the same manual, it is plainly
listed that:

Changes in release 3.23.6
-------------------------
   * Added `mysqld' option `-O lower_case_table_names={0|1}' to allow
     users to force table names to lowercase.

   * Added `SELECT ... INTO DUMPFILE'.

   .....

So, MySQL 3.22.x does not have the capability to produce dumpfiles,
only outfiles.

Ah.  I just read the whole of your message.  You are using a 3.22.32 server -
so, sorry, but you're out of luck :(

G'luck,
Peter

-- 
When you are not looking at it, this sentence is in Spanish.

> Perhaps this is a documentation goof (although I read the docs to mean
> the first form was correct, perhaps it could be clarified)
> One way or the other, this doesn't solve my probem ;)
> 
> Thanks for the feedback so far.
> 
> -Bill
> 
> Peter Pentchev wrote:
> > 
> > On Wed, May 09, 2001 at 09:20:52AM -0400, Bill Moran wrote:
> > > Thanks for the reply, but I need a binary transfer of the DATA in the
> > > field only. INTO OUTFILE does 2 things that corrupt the data:
> > > 1. Puts field data in the file
> > > 2. Escapes characters.
> > >
> > > As far as I can tell, I either have to use "INTO DUMPFILE" or I need to
> > > write a C program to do what I need.
> > > Any other suggestions?
> > 
> > The MySQL manual says:
> > 
> >      SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RES\
> > ULT]
> >             [HIGH_PRIORITY]
> >             [DISTINCT | DISTINCTROW | ALL]
> >          select_expression,...
> >          [INTO {OUTFILE | DUMPFILE} 'file_name' export_options]
> >          [FROM table_references
> > 
> > So try:
> > 
> >   SELECT resume INTO DUMPFILE '/data/file.doc' FROM apps WHERE appid=23
> > 
> > In other words, just move the 'INTO DUMPFILE' part where it belongs,
> > just after the expression, before any 'from' clauses :)
> > 
> > G'luck,
> > Peter
> > 
> > --
> > I am the thought you are now thinking.
> > 
> > > Robin Keech wrote:
> > > >
> > > > use
> > > > SELECT * INTO OUTFILE 'filename' .....
> > > >
> > > > -----Original Message-----
> > > > From: Bill Moran [mailto:[EMAIL PROTECTED]]
> > > > Sent: 09 May 2001 00:44
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Problem using "SELECT INTO DUMPFILE"
> > > >
> > > > I get an error stating: "you have an error in your SQL syntax near
> > > > 'dumpfile '/data/file.doc''"
> > > >
> > > > The command I'm trying to execute is:
> > > > select resume from apps where appid=23 into dumpfile '/data/file.doc'
> > > > The server and client are on two different computers.
> > > >
> > > > I'm using client version 3.23.36 on machine redfs
> > > > Server version 3.22.32 on machine redsql
> > > >
> > > > Do I need to upgrade the server before this will be possible? I
> > > > understand that SELECT INTO DUMPFILE must put the file on the local
> > > > machine, but does that mean when running the client on redfs, I'm trying
> > > > to put the file on redsql? (just thought of this, but it would be weird
> > > > to get that particular error if that were the case) That wouldn't work,
> > > > since there is no /data directory on redsql. If that's the problem, I
> > > > suppose I'll have to establish a NFS mount.
> > > >
> > > > Any pointers are welcome. Please keep me in the CC box as I'm not
> > > > currently subscribed to this list.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to