Table doesn't exist After Creating a Temp Table

﹥>﹥吖頭↗ 提交于 2019-12-01 04:08:37

问题


Hi I am creating a temp table and insert a record using

CREATE TEMPORARY TABLE temp_table_extension_details (
                  `Id` int NOT NULL,
                  `model_code` varchar(10),
                  `model_description` varchar(50),
                  `eta` varchar(100),
                  `options` varchar(100),
                  `order_numbers` varchar(200),
                  PRIMARY KEY(Id)
                );


 INSERT INTO temp_table_extension_details (model_code,model_description,eta,options,order_numbers) 
    VALUES('ABCD','description','eta','abc,bcd,def','123,234,345,456');

I tried this using PHPMyadmin and it says # 1 row affected.

but when i try to select the data using

SELECT * FROM temp_table_extension_details 

It gives me an error and says

SELECT * FROM temp_table_extension_details 
 LIMIT 0, 25 
MySQL said: Documentation

#1146 - Table 'trans.temp_table_extension_details' doesn't exist .

Is there any reson for this , i want to create a temp table and insert some data , later i will select all the data from it and delete the temp table .

Thanks in advance .


回答1:


Temporary tables only exist during the connection. If you create it with one query and then do a separate query on a new connection it is already gone.



来源:https://stackoverflow.com/questions/31444335/table-doesnt-exist-after-creating-a-temp-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!