PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Echoing Comments in MySQL Batch Files to Output
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Echoing Comments in MySQL Batch Files to Output

Réponse
 
LinkBack Outils de la discussion
Vieux 07/02/2008, 00h52   #1
Jack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Echoing Comments in MySQL Batch Files to Output

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.
  Réponse avec citation
Vieux 07/02/2008, 12h17   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Echoing Comments in MySQL Batch Files to Output

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
  Réponse avec citation
Vieux 10/02/2008, 05h25   #3
Jack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Echoing Comments in MySQL Batch Files to Output


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.
  Réponse avec citation
Vieux 10/02/2008, 21h24   #4
Charles Polisher
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Echoing Comments in MySQL Batch Files to Output

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?

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h30.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10761 seconds with 12 queries