Re: Can I use the information from SHOW STATUS in a SELECT statment ?

2005-08-16 Thread Sid Lane
I don't know if you can do it directly in a mysql shell like that
(like you would with v$, dba_ in Oracle) but if you call a show
command from PERL (via DBI) it hashes the result just like it were
from a select.

may not be the most elegant solution but its the best I've come up
with though I'll happily blush in embarassment if there's a direct
way I've not found...

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



RE: Can I use the information from SHOW STATUS in a SELECT statment ?

2005-08-16 Thread Mark Leith
 -Original Message-
 From: Sid Lane [mailto:[EMAIL PROTECTED] 
 Sent: 16 August 2005 14:54
 To: mysql@lists.mysql.com
 Subject: Re: Can I use the information from SHOW STATUS in 
 a SELECT statment ?
 
 I don't know if you can do it directly in a mysql shell like 
 that (like you would with v$, dba_ in Oracle) but if you call 
 a show command from PERL (via DBI) it hashes the result just 
 like it were from a select.
 
 may not be the most elegant solution but its the best I've 
 come up with though I'll happily blush in embarassment if 
 there's a direct
 way I've not found...

No you are absolutely correct, there is no way to for instance, use a SHOW
command in a sub query, or even in a cursor on version 5.. Of course, if you
are using version 5 then a lot of the SHOW commands are also being migrated
to the INFORMATION_SCHEMA, although not all of them as yet (such as SHOW
FULL PROCESSLIST) - and you can use those just like the DBA_ views in
Oracle.

So, the only fall back is to use an external script/application. I'm not
sure whether this is planned to be supported or not, but it would be nice to
grab the output of a SHOW command in a cursor, I was discussing this in
#mysql on freenode last night as it happens.. 

Mark

Mark Leith
Cool-Tools UK Limited
http://www.cool-tools.co.uk
http://leithal.cool-tools.co.uk 
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 15/08/2005
 


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



Re: Can I use the information from SHOW STATUS in a SELECT statment ?

2005-08-16 Thread Daniel

Speaking of Perl scripts that do this: http://codenode.com/mysqlreport
I almost never use SHOW STATUS directly anymore since most the
values have to be transformed one way or another to really be meaningful.

-Daniel

Sid Lane wrote:


I don't know if you can do it directly in a mysql shell like that
(like you would with v$, dba_ in Oracle) but if you call a show
command from PERL (via DBI) it hashes the result just like it were
from a select.

may not be the most elegant solution but its the best I've come up
with though I'll happily blush in embarassment if there's a direct
way I've not found...

 




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