vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| When I try using the --xml or --html option with a batch file using INTO OUTFILE 'dirpath', the --xml or --html option seems to be ignored in favor of the tab-delimited default. (If I get rid of the INTO OUTFILE, xml or html displays fine in the terminal.) I tried using the pager to write to a file from inside MySQL. I succeeded, but it was table data. I couldn't figure out how to add the --xml or --html options from inside the pager. I tried the redirection operator from the command line, but I haven't stumbled on the correct syntax if such a syntax does exist. Does anyone know how to write an --xml or --html file from a SELECT statement, either from the command line or from a batch file? This would really be useful information. Thanks in advance for reading or responding. |
| |||
| Hi John - using --xml or --html as an argument and redirecting to a file seems to work here. As in, mysql -u me -psecret -D database --html -e "select * from that_table" > ~/test_file.html HTH, Dan On 5/8/07, John Kebbel <kebbelj@scripting-solutions.com> wrote: > > When I try using the --xml or --html option with a batch file using INTO > OUTFILE 'dirpath', the --xml or --html option seems to be ignored in > favor of the tab-delimited default. (If I get rid of the INTO OUTFILE, > xml or html displays fine in the terminal.) > > I tried using the pager to write to a file from inside MySQL. I > succeeded, but it was table data. I couldn't figure out how to add the > --xml or --html options from inside the pager. > > I tried the redirection operator from the command line, but I haven't > stumbled on the correct syntax if such a syntax does exist. > > Does anyone know how to write an --xml or --html file from a SELECT > statement, either from the command line or from a batch file? This would > really be useful information. > > Thanks in advance for reading or responding. > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=drbuettner@gmail.com > > |
| |||
| At 6:09 PM -0400 5/8/07, John Kebbel wrote: >When I try using the --xml or --html option with a batch file using INTO >OUTFILE 'dirpath', the --xml or --html option seems to be ignored in >favor of the tab-delimited default. (If I get rid of the INTO OUTFILE, >xml or html displays fine in the terminal.) --xml and --html affect how the mysql client writes its output. INTO OUTFILE takes place on the server side. It cannot be affected by --xml or --html. (Or --batch or --table, either. >I tried using the pager to write to a file from inside MySQL. I >succeeded, but it was table data. I couldn't figure out how to add the >--xml or --html options from inside the pager. > >I tried the redirection operator from the command line, but I haven't >stumbled on the correct syntax if such a syntax does exist. It exists; this is a function of your command interpreter. But you're not likely to "stumble" on it; better to consult the documentation for your interpreter. For Unix, you can do something like this: Put statements in a file "x". Run mysql like this to capture output into "y": mysql --xml db_name < x > y -- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com |
| ||||
| Hello John, This works for me as well only I couldn't get the ~/test_file.html syntax to work so I changed it to C:\test_file.html and it worked. Thanks, Randall Price -----Original Message----- From: Dan Buettner [mailto:drbuettner@gmail.com] Sent: Tuesday, May 08, 2007 6:20 PM To: kebbelj@scripting-solutions.com Cc: MySQL Subject: Re: --xml or --html output to file Hi John - using --xml or --html as an argument and redirecting to a file seems to work here. As in, mysql -u me -psecret -D database --html -e "select * from that_table" > ~/test_file.html HTH, Dan On 5/8/07, John Kebbel <kebbelj@scripting-solutions.com> wrote: > > When I try using the --xml or --html option with a batch file using INTO > OUTFILE 'dirpath', the --xml or --html option seems to be ignored in > favor of the tab-delimited default. (If I get rid of the INTO OUTFILE, > xml or html displays fine in the terminal.) > > I tried using the pager to write to a file from inside MySQL. I > succeeded, but it was table data. I couldn't figure out how to add the > --xml or --html options from inside the pager. > > I tried the redirection operator from the command line, but I haven't > stumbled on the correct syntax if such a syntax does exist. > > Does anyone know how to write an --xml or --html file from a SELECT > statement, either from the command line or from a batch file? This would > really be useful information. > > Thanks in advance for reading or responding. > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=drbuettner@gmail.com > > |