Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
Checking if table exists in EDB |
Thu, Jul 30 2009 7:57 PM | Permanent Link |
"Adam H." | Hi,
I was wondering if anyone can please give me an example on how to see if a table exists within EDB? Looking at the manual it says "This property is no longer necessary. To determine if a table or view exists in a database, query the special Information Schema for the database.", but I can't find any additional in the manual about how to query the Special Information Schema. Thanks & Regards Adam. |
Thu, Jul 30 2009 8:18 PM | Permanent Link |
Fernando Dias Team Elevate | Adam,
You can test if a table exists searching the Information Schema, as follows: SELECT * FROM Information.Tables WHERE Name = 'YourTableName' You can also define a Delphi function, like this: Function TableExists(TableName: string): boolean; begin Result := EDBDatabase1.Execute( 'SELECT Version '+ 'FROM Information.Tables '+ 'WHERE Name =' + QuotedStr(TableName) )=1 ; end; -- Fernando Dias [Team Elevate] |
Thu, Jul 30 2009 8:21 PM | Permanent Link |
Richard Harding | Adam
>>Looking at the manual it says "This property is no longer necessary. To determine if a table or view exists in a database, query the special Information Schema for the database.", but I can't find any additional in the manual about how to query the Special Information Schema. The following query will result in 1 if the <TableName> table exists, otherwise 0. select Count(*) from Information.Tables WHERE Name = :TableName Richard Harding |
Fri, Jul 31 2009 12:29 AM | Permanent Link |
"Adam H." | Hi Guys,
And thanks for your help! Greatly apprecaited... Adam. |
Fri, Jul 31 2009 12:03 PM | Permanent Link |
"David Cornelius" | > I was wondering if anyone can please give me an example on how to see
> if a table exists within EDB? You might also want to check out the "extensions" newsgroup. There's a TableExists function posted about a year back that might come in handy. -- David Cornelius CorneliusConcepts.com |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |