Detecting TEMP tables .... HEEELP! ;-)
Posted in 1999
Topics: Stored Procedures & SPL
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
Hi; look in systabnames of sysmaster-database. 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