batch mode and redirect of out put to a text file....
am 07.12.2005 05:03:18 von Brozewicz Robert F
------_=_NextPart_001_01C5FAE3.283FD0C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hi all,
i have recently started to learn sql using mysql and have been following =
the tutorial. i would like to use batch mode and have ran into an issue.
i would like to redirect the output in batch mode to a text file. i =
have tried a few things and i am get the following error when i run the =
batch.
the error is=20
mysql> \. c:/words/cselect.sql > c:/words/cout.txt;
ERROR:
Failed to open file 'c:\words\cselect.sql > c:\words\cout.txt;', error: =
22
in the file cselect.sql i have the following simple select statement of =
"select * from shop;" when i add the redirection i get the above error. =
why are the slash turning into backslash when the error message is =
displayed?
can i redirect output in this manner? if so, what am i doing =
incorrectly?
where in the documentation can i read more about batch mode and =
redirection?
i am running mysql as a service on a windows xp desktop.
any and all comments are welcome.
bob brozewicz.
=20
The information contained in this e-mail may be confidential and is =
intended solely for the use of the named addressee.
Access, copying or re-use of the e-mail or any information contained =
therein by any other person is not authorized.
If you are not the intended recipient please notify us immediately by =
returning the e-mail to the originator.(17b)
------_=_NextPart_001_01C5FAE3.283FD0C0--
RE: batch mode and redirect of out put to a text file....
am 07.12.2005 05:55:01 von jbonnett
Redirection is an operating system thing rather than mysql.
What O/S are you using?
What exactly did you enter that caused this error, and where did you
enter it? (at the command prompt or a mysql prompt?)
It looks as if you are entering a "source" command interactively into
the mysql command line client program using the \. command. The only
thing following \. Can be a file name/path. You cannot have output
redirection there, only at the O/S command prompt.
If this SQL script is all you want to run you should be able to enter at
the O/S command prompt
mysql -u -h -p
>c:/words/cout.txt
and get the result you want.
John B.
-----Original Message-----
From: Brozewicz Robert F [mailto:brozewicz.rf@mellon.com]=20
Sent: Wednesday, 7 December 2005 2:33 PM
To: win32@lists.mysql.com
Subject: batch mode and redirect of out put to a text file....
hi all,
i have recently started to learn sql using mysql and have been following
the tutorial. i would like to use batch mode and have ran into an issue.
i would like to redirect the output in batch mode to a text file. i
have tried a few things and i am get the following error when i run the
batch.
the error is=20
mysql> \. c:/words/cselect.sql > c:/words/cout.txt;
ERROR:
Failed to open file 'c:\words\cselect.sql > c:\words\cout.txt;',
error: 22
in the file cselect.sql i have the following simple select statement of
"select * from shop;" when i add the redirection i get the above error.
why are the slash turning into backslash when the error message is
displayed?
can i redirect output in this manner? if so, what am i doing
incorrectly?
where in the documentation can i read more about batch mode and
redirection?
i am running mysql as a service on a windows xp desktop.
any and all comments are welcome.
bob brozewicz.
=20
The information contained in this e-mail may be confidential and is
intended solely for the use of the named addressee.
Access, copying or re-use of the e-mail or any information contained
therein by any other person is not authorized.
If you are not the intended recipient please notify us immediately by
returning the e-mail to the originator.(17b)
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org
Re: batch mode and redirect of out put to a text file....
am 07.12.2005 10:01:02 von cr.vegelin
Hi Bob,
See also the list of MySQL commands by typing ? after the >mysql prompt.
You will see the TEE or \T command to set the outputfile, like:
mysql> tee c:\words\cout.txt
Then run your script, like:
mysql> \. c:/words/cselect.sql
Regards, Cor
----- Original Message -----
From:
To: ;
Sent: Wednesday, December 07, 2005 4:55 AM
Subject: RE: batch mode and redirect of out put to a text file....
Redirection is an operating system thing rather than mysql.
What O/S are you using?
What exactly did you enter that caused this error, and where did you
enter it? (at the command prompt or a mysql prompt?)
It looks as if you are entering a "source" command interactively into
the mysql command line client program using the \. command. The only
thing following \. Can be a file name/path. You cannot have output
redirection there, only at the O/S command prompt.
If this SQL script is all you want to run you should be able to enter at
the O/S command prompt
mysql -u -h -p
>c:/words/cout.txt
and get the result you want.
John B.
-----Original Message-----
From: Brozewicz Robert F [mailto:brozewicz.rf@mellon.com]
Sent: Wednesday, 7 December 2005 2:33 PM
To: win32@lists.mysql.com
Subject: batch mode and redirect of out put to a text file....
hi all,
i have recently started to learn sql using mysql and have been following
the tutorial. i would like to use batch mode and have ran into an issue.
i would like to redirect the output in batch mode to a text file. i
have tried a few things and i am get the following error when i run the
batch.
the error is
mysql> \. c:/words/cselect.sql > c:/words/cout.txt;
ERROR:
Failed to open file 'c:\words\cselect.sql > c:\words\cout.txt;',
error: 22
in the file cselect.sql i have the following simple select statement of
"select * from shop;" when i add the redirection i get the above error.
why are the slash turning into backslash when the error message is
displayed?
can i redirect output in this manner? if so, what am i doing
incorrectly?
where in the documentation can i read more about batch mode and
redirection?
i am running mysql as a service on a windows xp desktop.
any and all comments are welcome.
bob brozewicz.
The information contained in this e-mail may be confidential and is
intended solely for the use of the named addressee.
Access, copying or re-use of the e-mail or any information contained
therein by any other person is not authorized.
If you are not the intended recipient please notify us immediately by
returning the e-mail to the originator.(17b)
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=cr.vegelin@hetnet.nl
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org