Re: PRINT statement?

2006-05-13 Thread Stephen Cook
, 
 as Value

UNION
select minimum_education_years=, @minimum_education_years
UNION
select birthdate_of_youngest_legal_worker=,
@birthdate_of_youngest_legal_worker;

The first SELECT produces only a blank line in the result set. 
Naturally, this is not important and you can delete the first 
SELECT and the UNION keyword that follows it if you want to remove 
the blank line. However, the first SELECT combines two other 
functions: it controls the column headings for the result set, via 
the AS clauses, AND, most importantly, it sets the width of the 
columns in the table, via the long blank-filled strings in the 
SELECT clause, e.g.  . Therefore, if 
you drop the first SELECT (and its UNION), you will find that the 
column names of the result set are the values from the (new) first 
SELECT, i.e. minimum_education_years= and 
@minimum_education_years, and, more importantly, that the width 
of the columns is too narrow and some of the information is 
truncated. For example the value shown for the second variable name 
is shown as birthdate_of_youngest_le and the VALUE of that 
variable is shown only as 1990, NOT the correct value, which is 
1990-05-11. The danger is that it is not obvious that the value 
of the variable has been truncated. When I first encountered this, 
I thought I'd written the date_sub() function incorrectly and 
messed around with it for awhile before I discovered the truncation 
problem. Therefore, my technique is to always use the first SELECT 
to set the column names for the result set AND to control the width 
of the result set columns.


--

Okay then, aside from the issue of string expressions, which I'm 
not sure about yet, I think we can see that SELECT can do 
everything else that the PRINT command supports.


--
Rhino

- Original Message - From: Quentin Bennett 
[EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]; Stephen Cook [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 11:59 PM
Subject: RE: PRINT statement?



From Transact-SQL Help file:


PRINT

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable 
must be char or varchar, or be able to be implicitly converted to 
those data types.


@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char 
or varchar, or be able to be implicitly converted to those data types.


string_expr

Is an expression that returns a string. Can include concatenated 
literal values and variables. The message string can be up to 8,000 
characters long; any characters after 8,000 are truncated.



-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it 
does. I
played with MS SQL Server once for a couple of days a few years 
back and

that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest 
another

alternative.

--
Rhino

- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


I've started using the SELECT with no other clauses but I am still 
curious

about a PRINT-like command.  It is for SQL scripts.

Rhino wrote:


- Original Message - From: Stephen Cook 
[EMAIL PROTECTED]

To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?


Is there a statement similar to PRINT in T-SQL (MicroSoft SQL 
Server)?


It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can 
simply use

the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or
HAVING clauses. For example:

   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to 
display
things. For example, I have some BASH scripts on our Linux server 
so I

can use the BASH echo command, like this:

   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 
09/05/2006




















--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-12 Thread Stephen Cook
 in 
the table, via the long blank-filled strings in the SELECT clause, 
e.g.  . Therefore, if you drop the 
first SELECT (and its UNION), you will find that the column names of 
the result set are the values from the (new) first SELECT, i.e. 
minimum_education_years= and @minimum_education_years, and, more 
importantly, that the width of the columns is too narrow and some of 
the information is truncated. For example the value shown for the 
second variable name is shown as birthdate_of_youngest_le and the 
VALUE of that variable is shown only as 1990, NOT the correct 
value, which is 1990-05-11. The danger is that it is not obvious 
that the value of the variable has been truncated. When I first 
encountered this, I thought I'd written the date_sub() function 
incorrectly and messed around with it for awhile before I discovered 
the truncation problem. Therefore, my technique is to always use the 
first SELECT to set the column names for the result set AND to 
control the width of the result set columns.


--

Okay then, aside from the issue of string expressions, which I'm not 
sure about yet, I think we can see that SELECT can do everything else 
that the PRINT command supports.


--
Rhino

- Original Message - From: Quentin Bennett 
[EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]; Stephen Cook [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 11:59 PM
Subject: RE: PRINT statement?



From Transact-SQL Help file:


PRINT

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable must 
be char or varchar, or be able to be implicitly converted to those 
data types.


@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char or 
varchar, or be able to be implicitly converted to those data types.


string_expr

Is an expression that returns a string. Can include concatenated 
literal values and variables. The message string can be up to 8,000 
characters long; any characters after 8,000 are truncated.



-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it does. I
played with MS SQL Server once for a couple of days a few years back and
that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest 
another

alternative.

--
Rhino

- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


I've started using the SELECT with no other clauses but I am still 
curious

about a PRINT-like command.  It is for SQL scripts.

Rhino wrote:


- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?


Is there a statement similar to PRINT in T-SQL (MicroSoft SQL 
Server)?


It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can 
simply use

the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or
HAVING clauses. For example:

   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to 
display

things. For example, I have some BASH scripts on our Linux server so I
can use the BASH echo command, like this:

   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 
09/05/2006














--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-12 Thread Mark Leith

Stephen Cook wrote:
There are such things as extensions to the standard, and many 
languages besides BASIC that have the ability to output a character 
string. No need to be snippy.


I will look into the --silent option, thanks!



I also tend to use -BN with these kind of scripts:


mysql -u user -BN dbname  file.sql
mysql -u root -BN -e SHOW DATABASES

etc.

Regards

Mark

--
Mark Leith, Support Engineer
MySQL AB, Worcester, England, www.mysql.com
Are you MySQL certified?  www.mysql.com/certification


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-12 Thread Peter Brawley
 headings for the result set, via 
the AS clauses, AND, most importantly, it sets the width of the 
columns in the table, via the long blank-filled strings in the 
SELECT clause, e.g.  . Therefore, if 
you drop the first SELECT (and its UNION), you will find that the 
column names of the result set are the values from the (new) first 
SELECT, i.e. minimum_education_years= and 
@minimum_education_years, and, more importantly, that the width 
of the columns is too narrow and some of the information is 
truncated. For example the value shown for the second variable name 
is shown as birthdate_of_youngest_le and the VALUE of that 
variable is shown only as 1990, NOT the correct value, which is 
1990-05-11. The danger is that it is not obvious that the value 
of the variable has been truncated. When I first encountered this, 
I thought I'd written the date_sub() function incorrectly and 
messed around with it for awhile before I discovered the truncation 
problem. Therefore, my technique is to always use the first SELECT 
to set the column names for the result set AND to control the width 
of the result set columns.


--

Okay then, aside from the issue of string expressions, which I'm 
not sure about yet, I think we can see that SELECT can do 
everything else that the PRINT command supports.


--
Rhino

- Original Message - From: Quentin Bennett 
[EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]; Stephen Cook [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 11:59 PM
Subject: RE: PRINT statement?



From Transact-SQL Help file:


PRINT

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable 
must be char or varchar, or be able to be implicitly converted to 
those data types.


@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char 
or varchar, or be able to be implicitly converted to those data types.


string_expr

Is an expression that returns a string. Can include concatenated 
literal values and variables. The message string can be up to 8,000 
characters long; any characters after 8,000 are truncated.



-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it 
does. I
played with MS SQL Server once for a couple of days a few years 
back and

that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest 
another

alternative.

--
Rhino

- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


I've started using the SELECT with no other clauses but I am still 
curious

about a PRINT-like command.  It is for SQL scripts.

Rhino wrote:


- Original Message - From: Stephen Cook 
[EMAIL PROTECTED]

To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?


Is there a statement similar to PRINT in T-SQL (MicroSoft SQL 
Server)?


It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can 
simply use

the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or
HAVING clauses. For example:

   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to 
display
things. For example, I have some BASH scripts on our Linux server 
so I

can use the BASH echo command, like this:

   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 
09/05/2006


















--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/336 - Release Date: 5/10/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-11 Thread Rhino
 
is to always use the first SELECT to set the column names for the result set 
AND to control the width of the result set columns.


--

Okay then, aside from the issue of string expressions, which I'm not sure 
about yet, I think we can see that SELECT can do everything else that the 
PRINT command supports.


--
Rhino

- Original Message - 
From: Quentin Bennett [EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]; Stephen Cook [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 11:59 PM
Subject: RE: PRINT statement?



From Transact-SQL Help file:


PRINT

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable must be char 
or varchar, or be able to be implicitly converted to those data types.


@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char or 
varchar, or be able to be implicitly converted to those data types.


string_expr

Is an expression that returns a string. Can include concatenated literal 
values and variables. The message string can be up to 8,000 characters long; 
any characters after 8,000 are truncated.



-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it does. I
played with MS SQL Server once for a couple of days a few years back and
that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest another
alternative.

--
Rhino

- Original Message - 
From: Stephen Cook [EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?



I've started using the SELECT with no other clauses but I am still curious
about a PRINT-like command.  It is for SQL scripts.

Rhino wrote:


- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?



Is there a statement similar to PRINT in T-SQL (MicroSoft SQL Server)?

It would be handy to debug some scripts.


If you're talking about a script that is running SQL, you can simply use
the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or
HAVING clauses. For example:

   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to display
things. For example, I have some BASH scripts on our Linux server so I
can use the BASH echo command, like this:

   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006






--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]

The information contained in this email is privileged and confidential and
intended for the addressee only. If you are not the intended recipient, you
are asked to respect that confidentiality and not disclose, copy or make use
of its contents. If received in error you are asked to destroy this email
and contact the sender immediately. Your assistance is appreciated.


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/336 - Release Date: 10/05/2006



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/336 - Release Date: 10/05/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-11 Thread Stephen Cook
 the value shown for the second 
variable name is shown as birthdate_of_youngest_le and the VALUE of 
that variable is shown only as 1990, NOT the correct value, which is 
1990-05-11. The danger is that it is not obvious that the value of the 
variable has been truncated. When I first encountered this, I thought 
I'd written the date_sub() function incorrectly and messed around with 
it for awhile before I discovered the truncation problem. Therefore, my 
technique is to always use the first SELECT to set the column names for 
the result set AND to control the width of the result set columns.


--

Okay then, aside from the issue of string expressions, which I'm not 
sure about yet, I think we can see that SELECT can do everything else 
that the PRINT command supports.


--
Rhino

- Original Message - From: Quentin Bennett 
[EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]; Stephen Cook [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 11:59 PM
Subject: RE: PRINT statement?



From Transact-SQL Help file:


PRINT

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable must be 
char or varchar, or be able to be implicitly converted to those data types.


@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char or 
varchar, or be able to be implicitly converted to those data types.


string_expr

Is an expression that returns a string. Can include concatenated literal 
values and variables. The message string can be up to 8,000 characters 
long; any characters after 8,000 are truncated.



-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it does. I
played with MS SQL Server once for a couple of days a few years back and
that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest another
alternative.

--
Rhino

- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


I've started using the SELECT with no other clauses but I am still 
curious

about a PRINT-like command.  It is for SQL scripts.

Rhino wrote:


- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?



Is there a statement similar to PRINT in T-SQL (MicroSoft SQL Server)?

It would be handy to debug some scripts.


If you're talking about a script that is running SQL, you can simply use
the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or
HAVING clauses. For example:

   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to display
things. For example, I have some BASH scripts on our Linux server so I
can use the BASH echo command, like this:

   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006








--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-11 Thread Peter Brawley
 the (new) first SELECT, i.e. 
minimum_education_years= and @minimum_education_years, and, more 
importantly, that the width of the columns is too narrow and some of 
the information is truncated. For example the value shown for the 
second variable name is shown as birthdate_of_youngest_le and the 
VALUE of that variable is shown only as 1990, NOT the correct 
value, which is 1990-05-11. The danger is that it is not obvious 
that the value of the variable has been truncated. When I first 
encountered this, I thought I'd written the date_sub() function 
incorrectly and messed around with it for awhile before I discovered 
the truncation problem. Therefore, my technique is to always use the 
first SELECT to set the column names for the result set AND to 
control the width of the result set columns.


--

Okay then, aside from the issue of string expressions, which I'm not 
sure about yet, I think we can see that SELECT can do everything else 
that the PRINT command supports.


--
Rhino

- Original Message - From: Quentin Bennett 
[EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]; Stephen Cook [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 11:59 PM
Subject: RE: PRINT statement?



From Transact-SQL Help file:


PRINT

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable must 
be char or varchar, or be able to be implicitly converted to those 
data types.


@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char or 
varchar, or be able to be implicitly converted to those data types.


string_expr

Is an expression that returns a string. Can include concatenated 
literal values and variables. The message string can be up to 8,000 
characters long; any characters after 8,000 are truncated.



-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it does. I
played with MS SQL Server once for a couple of days a few years back and
that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest 
another

alternative.

--
Rhino

- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


I've started using the SELECT with no other clauses but I am still 
curious

about a PRINT-like command.  It is for SQL scripts.

Rhino wrote:


- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?


Is there a statement similar to PRINT in T-SQL (MicroSoft SQL 
Server)?


It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can 
simply use

the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or
HAVING clauses. For example:

   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to 
display

things. For example, I have some BASH scripts on our Linux server so I
can use the BASH echo command, like this:

   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 
09/05/2006












--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/336 - Release Date: 5/10/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-10 Thread Stephen Cook
I've started using the SELECT with no other clauses but I am still 
curious about a PRINT-like command.  It is for SQL scripts.


Rhino wrote:


- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?



Is there a statement similar to PRINT in T-SQL (MicroSoft SQL Server)?

It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can simply use 
the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or 
HAVING clauses. For example:


   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to display 
things. For example, I have some BASH scripts on our Linux server so I 
can use the BASH echo command, like this:


   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-10 Thread Rhino
I am not familiar with the PRINT command so I don't know what it does. I 
played with MS SQL Server once for a couple of days a few years back and 
that is the only contact I've ever had with SQL Server.


If you can tell me what PRINT does, in detail, maybe I can suggest another 
alternative.


--
Rhino

- Original Message - 
From: Stephen Cook [EMAIL PROTECTED]

To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


I've started using the SELECT with no other clauses but I am still curious 
about a PRINT-like command.  It is for SQL scripts.


Rhino wrote:


- Original Message - From: Stephen Cook [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?



Is there a statement similar to PRINT in T-SQL (MicroSoft SQL Server)?

It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can simply use 
the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or 
HAVING clauses. For example:


   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to display 
things. For example, I have some BASH scripts on our Linux server so I 
can use the BASH echo command, like this:


   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006






--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: PRINT statement?

2006-05-10 Thread Quentin Bennett
From Transact-SQL Help file:

PRINT 

Returns a user-defined message to the client.

Syntax
PRINT 'any ASCII text' | @local_variable | @@FUNCTION | string_expr

Arguments
'any ASCII text'

Is a string of text.

@local_variable

Is a variable of any valid character data type. @local_variable must be char or 
varchar, or be able to be implicitly converted to those data types.

@@FUNCTION

Is a function that returns string results. @@FUNCTION must be char or varchar, 
or be able to be implicitly converted to those data types.

string_expr

Is an expression that returns a string. Can include concatenated literal values 
and variables. The message string can be up to 8,000 characters long; any 
characters after 8,000 are truncated.


-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 May 2006 3:51 p.m.
To: Stephen Cook
Cc: MySQL List
Subject: Re: PRINT statement?


I am not familiar with the PRINT command so I don't know what it does. I 
played with MS SQL Server once for a couple of days a few years back and 
that is the only contact I've ever had with SQL Server.

If you can tell me what PRINT does, in detail, maybe I can suggest another 
alternative.

--
Rhino

- Original Message - 
From: Stephen Cook [EMAIL PROTECTED]
To: Rhino [EMAIL PROTECTED]
Cc: MySQL List mysql@lists.mysql.com
Sent: Wednesday, May 10, 2006 8:09 PM
Subject: Re: PRINT statement?


 I've started using the SELECT with no other clauses but I am still curious 
 about a PRINT-like command.  It is for SQL scripts.

 Rhino wrote:

 - Original Message - From: Stephen Cook [EMAIL PROTECTED]
 To: MySQL List mysql@lists.mysql.com
 Sent: Sunday, May 07, 2006 3:53 AM
 Subject: PRINT statement?


 Is there a statement similar to PRINT in T-SQL (MicroSoft SQL Server)?

 It would be handy to debug some scripts.

 If you're talking about a script that is running SQL, you can simply use 
 the SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or 
 HAVING clauses. For example:

select Creating Foo table as Action;

 will produce the following output:

+--+
| Action   |
+--+
| Creating Foo table |
+--+
1 row in set (0.00 sec)

 If you're talking about an OS script, you can use OS commands to display 
 things. For example, I have some BASH scripts on our Linux server so I 
 can use the BASH echo command, like this:

#!/bin/bash
report_date=`/bin/date`
echo Report Date: $report_date;

 to produce this output:

Report Date: Sun May 7 09:42:57 EDT 2006


 -- 
 Rhino






 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006

 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/335 - Release Date: 09/05/2006


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
The information contained in this email is privileged and confidential and
intended for the addressee only. If you are not the intended recipient, you
are asked to respect that confidentiality and not disclose, copy or make use
of its contents. If received in error you are asked to destroy this email
and contact the sender immediately. Your assistance is appreciated.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: PRINT statement?

2006-05-07 Thread Rhino


- Original Message - 
From: Stephen Cook [EMAIL PROTECTED]

To: MySQL List mysql@lists.mysql.com
Sent: Sunday, May 07, 2006 3:53 AM
Subject: PRINT statement?



Is there a statement similar to PRINT in T-SQL (MicroSoft SQL Server)?

It would be handy to debug some scripts.

If you're talking about a script that is running SQL, you can simply use the 
SELECT statement without any FROM, WHERE, ORDER BY, GROUP BY or HAVING 
clauses. For example:


   select Creating Foo table as Action;

will produce the following output:

   +--+
   | Action   |
   +--+
   | Creating Foo table |
   +--+
   1 row in set (0.00 sec)

If you're talking about an OS script, you can use OS commands to display 
things. For example, I have some BASH scripts on our Linux server so I can 
use the BASH echo command, like this:


   #!/bin/bash
   report_date=`/bin/date`
   echo Report Date: $report_date;

to produce this output:

   Report Date: Sun May 7 09:42:57 EDT 2006


--
Rhino




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 05/05/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]