Re: Detecting TEMP tables .... HEEELP! ;-)
Posted in 1999
Try:
BEGIN
ON EXCEPTION IN (-206)
END EXCEPTION WITH RESUME;
DROP TABLE my_table;
CREATE TEMP TABLE my_table (whatether columns you have);END;
Hope it helps,
Octav
On Mon, May 03, 1999 at 08:06:31PM -0700, Richard Auslander wrote:
> In a stored procedure, using Dynamic Server 7.30 (thought it shouldn't
> matter), how can I tell if a temp table already exists? This is an
> age-old Informix problem, where it's an error if you create a table that
> already exists, and an error if you delete one that doesn't ... you
> can't win, and all I want to do is delete it if it exists. Kind of like
> Oracle's "CREATE OR REPLACE" <grin>. Any help would be much
> appreciated. BTW, I hunted through 'systables' (the obvious solution),
> and temp tables are not included there, or anywhere else to my
> knowledge. Thanks!
>
> Rich
> --
> Richard C. Auslander
> Database Manager
>
> AirFlash, Inc.
> 1733 Woodside Rd., Suite #110
> Redwood City, CA 94061
> (650) 556-7928
>
> www.airflash.com
>
--
Octav Chiriac Phone: (373) 2 21 20 96
NetInfo S.R.L. Fax: (373) 2 21 36 59
Chisinau (373) 2 24 00 83
Moldova, Republic of mailto:com@netinfo-moldova.com