Re: Check if a table exists
Posted by: Bob Field
Date: August 27, 2006 09:17AM

I'm not sure what an Advantage database is, but you can query the INFORMATION_SCHEMA `tables` system view which returns a list of all tables on the server instance. You can narrow the select by specifying table_schema or table_name in your WHERE clause. There's any number of ways to code this statement. Here is one example:
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'databasename'
AND table_name = 'tablename';
If no rows are returned, the table does not exist.

Options: ReplyQuote


Subject
Views
Written By
Posted
134683
August 24, 2006 09:12AM
Re: Check if a table exists
72123
August 27, 2006 09:17AM
45256
September 06, 2006 12:36PM
41922
November 12, 2006 11:44PM
41465
November 13, 2006 09:05AM
47409
January 11, 2007 09:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.