Hi.

On Thu, Oct 04, 2001 at 07:53:15AM +0800, [EMAIL PROTECTED] wrote:
> > "batch mode" doesn't necessarily mean "raw mode". You want to ask for
> > "raw mode", but ask for "batch mode".
> 
> Luckily this led me to look up the letter "r" in command line options
> and I happened to find the "-r" option. Which is exactly what I need.

Fine.

> My question was so clear. I have to wonder why 3 prior responses did not
> even hint at the solution.

Simply because I did not know!? 

Aside from that, I spent the time to created a work-around for you, so
you already have a solution.

> Your first response sought to justify why mySQL was giving me the
> unwanted result. Then you suggested converting mySQL's result with
> another tool.

What's wrong with the last? It works, doesn't it?

Sorry, that I wanted to help. :-/

I simply tried to explain why it does what it does (regardless if this
is considered reasonable by you or me).

> But I simply need "-r".
> 
> Actually the manual, for "-r", says only: "Write column values without
> escape conversion. Used with --batch." What does this mean exactly? Is
> it only that newlines in output data will not be converted to "\n"?

>From the output format, I assume that it does the same with tabs
(because tab is used as field seperator). And maybe also for 0-bytes.
And of course with backslashes, because backslashes got a special
meaning now:

mysql -N -B -e "select 'test\tasdf\01234\\qwert'"
test\tasdf\01234\\qwert

I had a look at the source and in fact, that are exactly all cases.

> I don't see "escape conversion" documented.

Don't know either.

> > But doing it this way would render the output completely useless for
> > all uses, except for your special case.
> 
> I really have no idea what you mean here. Without -r, mySQL converts
> newlines in output data to the 2 characters slash, n ("\n"). Why would
> output be "completely useless" if it didn't do this??

I explained that in my last mail in the part to which you reply here.
Except for the special case, were you know which data belong to which
row, you couldn't tell whether a newline is a newline or the seperator
for a new row.

Bye,

        Benjamin.

-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
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