创建临时表后该表不存在 [英] Table doesn't exist After Creating a Temp Table

查看:637
本文介绍了创建临时表后该表不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个临时表并使用

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');

我使用PHPMyadmin尝试过,它说# 1 row affected.

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

但是当我尝试使用

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 .

谢谢.

推荐答案

临时表仅在连接期间存在.如果您使用一个查询创建它,然后对新连接进行单独的查询,则它已经消失了.

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.

这篇关于创建临时表后该表不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆