Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 26, 2013 07:00 AM by Jane1987
Feb 26, 2013 05:35 AM|LINK
I got a question regarding create temporary table in mysql.
Let's say i create temporary table in my code,
CREATE Temporary TABLE table.T2 (select * from testing.Category)
izzit after " myConnection.Close() " all the temporary i create will disappear?
So if yes, is there any better way to prevent the table disappear/dropped from database as i need to select the data in temporary and populate it to gridview.
Feb 26, 2013 06:29 AM|LINK
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.
Please refer below links,
Feb 26, 2013 06:43 AM|LINK
When you use temporary it will be available only for that connection. If you want to make available the same table for another connection remove the temporary key word from your query and then use.
Feb 26, 2013 07:00 AM|LINK
That means after myconnection.close(), the temporary table will drop itself?