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]