At 06:56 AM 12/18/2004, you wrote:
Hi,
   I'm using MySql 4.1.4 gamma and there are certain circumstances in
wich I need to create tables with random names from within querys.

And after using them I need to drop them; so I need a way to *remember*
these table names so I can dispose them later.

Is that possible with MySql?

Thank you
Mauricio


P.S.: I 've already tryed with temporary tables and they`re ok but sometimes I need to use them twice in the same query and that`s not possible.


Mauricio,
That is best handled by your programming language, like PHP, and you will get it to create the entire SQL "Create Table" string that gets executed (it can still be a temporary table but with a random table name). Example: "TMP_1234". When the temporary table is created, add it to a PHP array so you can delete it later. You can also do a Show Tables like "TMP\_%" to get a list of all tables that start with "TMP_". You can either use a random number for the table name (checking first to make sure the table with that name does not exist, or use the process id number. PHP: "posix_getpid()").


Mike


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



Reply via email to