![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » Search Forums » Search Results » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Mon, Nov 12 2007 12:03 PM | Permanent Link |
L Duncan | I am trying to find out if a temporary table exists before dropping it and creating again using the following code: with memorydatabase do begin Connected := True; Open; //if the memory table exists then drop if (Execute('SELECT * FROM Information.Tables WHERE Name='+Engine.QuotedSQLStr('PlanHoldings'))=1) then Execute('DROP TABLE "PlanHoldings"'); Execute('CREATE TEMPORARY TABLE ...'); Close; end; Unfortunately I think it is the if (Execute('SELECT * FROM Information.Tables WHERE Name='+Engine.QuotedSQLStr('PlanHoldings'))=1) then that is not picking up the existence of the table, although I do get errors stating it exists when I try and create it. regards |
Mon, Nov 12 2007 7:33 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | << Unfortunately I think it is the if (Execute('SELECT * FROM Information.Tables WHERE Name='+Engine.QuotedSQLStr('PlanHoldings'))=1) then that is not picking up the existence of the table, although I do get errors stating it exists when I try and create it. >> Temporary tables do not show up in the catalog tables. You'll have to just enclose the DROP TABLE statement inside of an EXCEPTION block: BEGIN EXECUTE IMMEDIATE 'DROP TABLE...'; EXCEPTION END -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Nov 13 2007 6:40 AM | Permanent Link |
L. Duncan | "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote: BEGIN EXECUTE IMMEDIATE 'DROP TABLE...'; EXCEPTION END Thank you, much appreciated. regards |
This web page was last updated on Saturday, June 22, 2024 at 05:51 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |