Re: Determining if a table exists

2005-05-03 Thread Dusan Kolesar
On Mon, 02 May 2005 19:56:49 +0200, Eric Bergen [EMAIL PROTECTED]  
wrote:

The column name is Tables_in_mysql. show syntax doesn't support order  
by. Information_schema tables in 5.0 do because they use the normal  
select syntax.

-Eric
Jim McAtee wrote:
Hey, thanks.
show tables like 'jst%_foo'
looks like it would work just fine.  Two questions:
What is the column name returned and can I do an ORDER BY?  If so, then  
I can just check the first and last rows in the results to determine  
the numeric range.

My bad - server version is 3.23.x.  Dictated by this (old as alabama)  
application.  They refuse to support newer versions of MySQL.

- Original Message - From: Eric Bergen [EMAIL PROTECTED]
To: Jim McAtee [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Monday, May 02, 2005 11:31 AM
Subject: Re: Determining if a table exists

I don't remember what commands are available in 3.21 but try these
show tables like 'table_name';
then check mysql_num_rows on the result.
describe table;
check mysql_num_rows
show tables;
then pick out the table name;
3.21 is old as alabama (forrest gump) it's time for an upgrade :)
Jim McAtee wrote:
We're running an application that creates table names in a numeric  
sequence.  For example:

jst998_foo
jst998_bar
jst999_foo
jst999_bar
jst0001000_foo
jst0001000_bar
jst0001001_foo
jst0001001_bar
I need to write a maintenance app that first needs to determine the  
numeric range of existing tables.  In the above example it would be  
998 to 1001.

What would be a half-way efficient way of doing this?
MySQL version is 3.21.x, with MyISAM tables.



Hello,
What about:
SELECT * FROM `information_schema`.`TABLES`
  where TABLE_SCHEMA = 'databaseName' AND TABLE_TYPE = 'BASE TABLE' AND  
TABLE_NAME LIKE 'jst%'

--
Dusan Kolesar
Helsinska 19
040 13  Kosice
Slovakia
e-mail : [EMAIL PROTECTED]
ICQ# : 160507424
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: order by version number

2005-04-29 Thread Dusan Kolesar
On Fri, 29 Apr 2005 08:20:58 +0200, Stano Paska [EMAIL PROTECTED]
wrote:
Hi,
 in my table I have one varchar(20) column where I store version number.
Version looks like:
1.1.2
1.2.1
1.10.3
It is possible order this column in natural order (1.2 before 1.10)?
 Stano.
Hello Stano,
What about divide 1 text column into 3 integer columns?
SELECT * FROM table ORDER BY MajorVersion, MinorVersion, Release
Dusan
--
Dusan Kolesar
Helsinska 19
040 13  Kosice
Slovakia
e-mail : [EMAIL PROTECTED]
ICQ# : 160507424
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Notification

2003-06-17 Thread Dusan Kolesar
Hello,

I have a problem:
If there are more then one clients connected into server 
and one of them changes databese, how can server notify 
other clients that data was changed. It is important for refresh 
view in client program.

Thanks.


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