Re: How do I drop a temp table in (P)ISQL?
Posted in 1994
>From: millers@govonca.gov.on.ca (Stu Miller)
>Subject: How do I drop a temp table in (P)ISQL?
>Date: Fri, 12 Aug 1994 17:01:03 GMT
>X-Informix-List-Id: <news.8146>
>
>I had a user ask me how to drop a temp table in ISQL the other day and I
>told him that I always just exit and re-load ISQL. I do this to avoid the
>possibility of dropping the wrong table!
>
>It occurred to me that there must be a way to do this using the DROP
>command but I'll be dammed if I can get it to work! When I try the DROP
>command, the temp table is not in the list of tables that ISQL returns.
>The only way I can seem to make changes to the SQL script and re-run it
>is to change the name of the temp table in the script or exit and reload ISQL.
Which version of which Engine (OnLine or SE) are you using?
The basic answer to dropping temporary tables is the DROP TABLE command:
CREATE TEMP TABLE T ( ... );
DROP TABLE T;
SELECT ... INTO TEMP T;
DROP TABLE T;
However, there have been versions of the Engines where the temporary tables
were not dropped. If you have tried the DROP TABLE command to no effect,
then the chances are that you have one of those versions. The answer, in
that case, is to upgrade. To the best of my knowledge, those bugs have
been fixed for a number of releases.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>