dbTalk Databases Forums  

Error Piping Query at Windows Prompt

comp.databases comp.databases


Discuss Error Piping Query at Windows Prompt in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Suhasw
 
Posts: n/a

Default Error Piping Query at Windows Prompt - 01-23-2008 , 03:54 PM






Hi,

I was trying to redirect output of a query to file attached to root
of drive c:\ . I am trying to look up type of data stored in various
tables and the sort of data is being stored.

When I use this command

echo " select * from companies order by id desc limit 10;" | mysql -u
root -p > customerapp c:/result.txt;

Then it asks me for my root password, that I feed in here.

At this point it is giving the following error.
"The process tried to write to a nonexistent pipe."

Here customerapp is the name of the database. I have treid to use /u
switch before database name (not sure about that) and --database
switch both have not worked.

Please help thanks in advance.

Reply With Quote
  #2  
Old   
Luuk
 
Posts: n/a

Default Re: Error Piping Query at Windows Prompt - 01-24-2008 , 03:09 AM







"Suhasw" <suhas.walanjoo (AT) gmail (DOT) com> schreef in bericht
news:2ce5ee7d-53fb-4920-b4a0-5be9a7d67bce (AT) l1g2000hsa (DOT) googlegroups.com...
Quote:
Hi,

I was trying to redirect output of a query to file attached to root
of drive c:\ . I am trying to look up type of data stored in various
tables and the sort of data is being stored.

When I use this command

echo " select * from companies order by id desc limit 10;" | mysql -u
root -p > customerapp c:/result.txt;

Then it asks me for my root password, that I feed in here.

At this point it is giving the following error.
"The process tried to write to a nonexistent pipe."

Here customerapp is the name of the database. I have treid to use /u
switch before database name (not sure about that) and --database
switch both have not worked.

Please help thanks in advance.
try:
mysql -u root -p -e "select * from companies order by id desc limit 10;"
Quote:
c:\result.txt
what do you want to achieve with this part of your command: " > customerapp
c:/result.txt;"
the output is redirected to 'customerapp' (because of the '> customerapp')
and then it finds 'c:/result.txt', and windows will ....
if its the name of the database you are selecting you should to that before
the '>'

mysql -u root -p -e "select * from companies order by id desc limit 10;"
customerapp>c:\result.txt







Reply With Quote
  #3  
Old   
Luuk
 
Posts: n/a

Default Re: Error Piping Query at Windows Prompt - 01-24-2008 , 03:09 AM




"Suhasw" <suhas.walanjoo (AT) gmail (DOT) com> schreef in bericht
news:2ce5ee7d-53fb-4920-b4a0-5be9a7d67bce (AT) l1g2000hsa (DOT) googlegroups.com...
Quote:
Hi,

I was trying to redirect output of a query to file attached to root
of drive c:\ . I am trying to look up type of data stored in various
tables and the sort of data is being stored.

When I use this command

echo " select * from companies order by id desc limit 10;" | mysql -u
root -p > customerapp c:/result.txt;

Then it asks me for my root password, that I feed in here.

At this point it is giving the following error.
"The process tried to write to a nonexistent pipe."

Here customerapp is the name of the database. I have treid to use /u
switch before database name (not sure about that) and --database
switch both have not worked.

Please help thanks in advance.
try:
mysql -u root -p -e "select * from companies order by id desc limit 10;"
Quote:
c:\result.txt
what do you want to achieve with this part of your command: " > customerapp
c:/result.txt;"
the output is redirected to 'customerapp' (because of the '> customerapp')
and then it finds 'c:/result.txt', and windows will ....
if its the name of the database you are selecting you should to that before
the '>'

mysql -u root -p -e "select * from companies order by id desc limit 10;"
customerapp>c:\result.txt







Reply With Quote
  #4  
Old   
Luuk
 
Posts: n/a

Default Re: Error Piping Query at Windows Prompt - 01-24-2008 , 03:09 AM




"Suhasw" <suhas.walanjoo (AT) gmail (DOT) com> schreef in bericht
news:2ce5ee7d-53fb-4920-b4a0-5be9a7d67bce (AT) l1g2000hsa (DOT) googlegroups.com...
Quote:
Hi,

I was trying to redirect output of a query to file attached to root
of drive c:\ . I am trying to look up type of data stored in various
tables and the sort of data is being stored.

When I use this command

echo " select * from companies order by id desc limit 10;" | mysql -u
root -p > customerapp c:/result.txt;

Then it asks me for my root password, that I feed in here.

At this point it is giving the following error.
"The process tried to write to a nonexistent pipe."

Here customerapp is the name of the database. I have treid to use /u
switch before database name (not sure about that) and --database
switch both have not worked.

Please help thanks in advance.
try:
mysql -u root -p -e "select * from companies order by id desc limit 10;"
Quote:
c:\result.txt
what do you want to achieve with this part of your command: " > customerapp
c:/result.txt;"
the output is redirected to 'customerapp' (because of the '> customerapp')
and then it finds 'c:/result.txt', and windows will ....
if its the name of the database you are selecting you should to that before
the '>'

mysql -u root -p -e "select * from companies order by id desc limit 10;"
customerapp>c:\result.txt







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.