MySQL Forums
Forum List  »  InnoDB

Create Temporary Table with same name as non-temporary table
Posted by: Alejandro Diaz
Date: May 13, 2008 05:05AM

Hello,

I'm trying to create a temporary table with the same name as a non-temporary table in my database:

My SQL Code:
create temporary table menuprincipal like menuprincipal

The error msg:
[mysqld-5.0.45-community-nt]Not unique table/alias: 'menuprincipal'

The "menuprincipal" is a dummy table I've created from wich every cliente will run a new instance (temporary table) from.

As the MySql reference manual says:
You can use the TEMPORARY keyword when creating a table. A TEMPORARY table is visible only to the current connection, and is dropped automatically when the connection is closed. This means that two different connections can use the same temporary table name without conflicting with each other or with an existing non-TEMPORARY table of the same name. (The existing table is hidden until the temporary table is dropped.) To create temporary tables, you must have the CREATE TEMPORARY TABLES privilege.


I've searched over the internet without finding any answer. The manual says it could be done but it really doesn't work. Could anyone help?


Best regards,
Alex (Barcelona, Spain)



Edited 1 time(s). Last edit at 05/13/2008 05:10AM by Alejandro Diaz.

Options: ReplyQuote


Subject
Views
Written By
Posted
Create Temporary Table with same name as non-temporary table
4802
May 13, 2008 05:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.