Re: dynamic table name

2009-04-26 Thread Peter Brawley
DECLARE my_table CHAR(32); SET my_table = UNIX_TIMESTAMP(); CREATE TABLE my_table See the manual page for PREPARE. PB - Mauricio Tellez wrote: Hi, I'm creating a stored procedure and inside this procedure I have a CREATE TABLE statement, but I want to make a dynamic table for

dynamic table name

2009-04-26 Thread Mauricio Tellez
Hi, I'm creating a stored procedure and inside this procedure I have a CREATE TABLE statement, but I want to make a dynamic table for this table. Also, this table name is passed as a parameter for another SP, but instead of get the value of the parameter, I got the name of the parameter. For exampl

RE: SOLVED! (was: RE: Error : Incorrect key file for table 'X')

2009-04-26 Thread abdulazeez alugo
> From: ad...@asarian-host.net > Subject: SOLVED! (was: RE: Error : Incorrect key file for table 'X') > Date: Sun, 26 Apr 2009 21:15:15 + > To: mysql@lists.mysql.com > > Okay, I finally got it fixed. I was on the right track going the mysqldump > route, but turns out I had to physically do a

SOLVED! (was: RE: Error : Incorrect key file for table 'X')

2009-04-26 Thread Mark
Okay, I finally got it fixed. I was on the right track going the mysqldump route, but turns out I had to physically do a 'rm -rf' on the mysql dir (sans the mysql database itself; and after mysqld was shut down, of course), even though I had mysqldump add command to DROP existing databases first. A

RE: Error : Incorrect key file for table 'X'

2009-04-26 Thread Mark
I found out it's actually a documented bug, for folks upgrading from 5.0.x to 5.1.x, http://bugs.mysql.com/bug.php?id=37631 And occurs with tables originally created with 4.0.x. There's currently no fix, it seems. There's a patch, but dev-comments to that patch suggest it can cause crashes

Re: Ordering cars

2009-04-26 Thread zhu dingze
select brand, max(year) from cars group by year order by yearunion select brand, year from cars order by year 2009/4/25 Olav Mørkrid > Say I have a table with any number of car brands, with belonging street > dates. > > Is it possible to do the following type of sort in a single query? > > 1. F

Re: Error : Incorrect key file for table 'X'

2009-04-26 Thread zhu dingze
Hey Dude, So many errors imply that there are some issues with your meta_data other than the tables and files itself. Please note, MySQL has upgrade some information in Information_schema Database. May I ask which kind of data have you been backup? including information_schema. Bests, Dingze 2