|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'm running MySQL 5.0 under Windows XP and typically submit files for
batch processing from a command window and redirect stdout to an output file, e.g. mysql --user=root -vvv -t < myfile.sql >myfile.out I'd like to insert what amount to titles in various places in my output file. One way to do this would be to echo comment lines from my sql program file to the output file -- is there a way to do this? Back when I was a SAS user, I could use a command called "title" that worked like: title "This will appear in the output file so you know what you're looking at" ; And the quoted text would appear over output from the next procedure. Does MySQL have a facility like this? Thanks in advance. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 7 Feb, 00:52, Jack <jwilliam...@lecg.com> wrote:
> I'm running MySQL 5.0 under Windows XP and typically submit files for > batch processing from a command window and redirect stdout to an > output file, e.g. > > mysql --user=root -vvv -t < myfile.sql >myfile.out > > I'd like to insert what amount to titles in various places in my > output file. One way to do this would be to echo comment lines from my > sql program file to the output file -- is there a way to do this? > > Back when I was a SAS user, I could use a command called "title" that > worked like: > > title "This will appear in the output file so you know what you're > looking at" ; > > And the quoted text would appear over output from the next procedure. > > Does MySQL have a facility like this? > > Thanks in advance. How about: SELECT "This is a comment" comment |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanks, Captain P. select "this is a comment" comment ; will work, sort of -- it produces output that looks like: -------------- select "this is a comment" comment -------------- +-------------------+ | comment | +-------------------+ | this is a comment | +-------------------+ 1 row in set (0.00 sec) Not really the same as echoing a comment to the output file or the effect of a real title command, but I guess running the output thru a little awk script could make this work OK. And a guy can't eat steak every day. Thanks again. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 2008-02-07, Jack <jwilliamson@lecg.com> wrote:
> I'm running MySQL 5.0 under Windows XP and typically submit files for > batch processing from a command window and redirect stdout to an > output file, e.g. > > mysql --user=root -vvv -t < myfile.sql >myfile.out > > I'd like to insert what amount to titles in various places in my > output file. One way to do this would be to echo comment lines from my > sql program file to the output file -- is there a way to do this? > > Back when I was a SAS user, I could use a command called "title" that > worked like: > > title "This will appear in the output file so you know what you're > looking at" ; > > And the quoted text would appear over output from the next procedure. > > Does MySQL have a facility like this? > > Thanks in advance. Would "SELECT 'Title goes here';" work for you? |
|
![]() |
| Outils de la discussion | |
|
|